Guest User

Untitled

a guest
Feb 27th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. $stmt = $db->prepare("SELECT post_id,content,date,category_id,lp_title,lp_image,lp_canonicalUrl,lp_url,lp_desc,lp_iframe,lp_iframe_id
  2. FROM post_items inner JOIN user ON post_items.user_id = user.user_id
  3. WHERE post_items.user_id = ? order by post_items.post_id desc LIMIT ?,?");
  4.  
  5. $stmt->bind_param('iii', $userid, $itemStart, $itemEnd);
  6.  
  7. $stmt2 = $db->prepare("SELECT photo_upload.img_src FROM photo_upload inner JOIN post_items ON post_items.photo_set_id = photo_upload.photo_set_id
  8. WHERE post_items.photo_set_id = photo_upload.photo_set_id ");
  9.  
  10. if ($stmt2->execute()) {
  11. $photo_items = $stmt2->get_result();
  12.  
  13. while ($obj2 = $photo_items->fetch_object()) {
  14.  
  15. $jsonData[] = $obj2;
  16.  
  17. }
  18.  
  19. $i2 = json_encode($jsonData);
  20. }
  21.  
  22. if($stmt->execute()){
  23.  
  24. $post_items = $stmt->get_result();
  25.  
  26. if(mysqli_num_rows($post_items) > 0){
  27. while ($obj = $post_items->fetch_object()) {
  28.  
  29. $jsonData[] = $obj;
  30. }
  31.  
  32. $i = json_encode($jsonData);
  33.  
  34. echo $i;
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment