$start = $_REQUEST["start"]; $get_images = $_REQUEST["get_images"]; if(!isset($start)) $start = 0; // if(isset($get_images)){ $db = new PDO("sqlite:/sqlite/naked.sql3"); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $img = $db->query("SELECT * FROM (SELECT * FROM images WHERE display='1' ORDER BY id DESC LIMIT 5 OFFSET $start) ORDER BY data DESC")->fetchAll();//PDO::FETCH_ASSOC); // $img = array_reverse($img, FALSE); // foreach($img as $im){ //$wh = getimagesize("images/galeria/?img=" . $im["src"]);// . "&w=200&h=200"); $wh = @getimagesize("images/galeria/" . $im["src"]);// . "&w=200&h=200"); $arr[$im["id"]] = array("id" => $im["id"],"src" => $im["src"],"opis" => $im["opis"],"width" => $wh[0],"height" => $wh[1]); } echo json_encode($arr,FALSE); die; } // ?>