PHP SQL query error

前端 未结 6 2157
忘了有多久
忘了有多久 2021-01-26 07:26

I have some problem with type conversation in this code (working with Facebook PHP SDK 3.0.1):

$page_id = 192485754113829;
$post_limit = 2;

$query = \"select po         


        
6条回答
  •  情话喂你
    2021-01-26 08:08

    $query = "select post_id, source_id, actor_id, target_id, created_time, likes, message, attachment, comments from stream where source_id = '$page_id' LIMIT $post_limit";
    

    or

    $query = "select post_id, source_id, actor_id, target_id, created_time, likes, message, attachment, comments from stream where source_id = '".$page_id."' LIMIT ".$post_limit."";
    

    (if page_id is an integer you can write it without any quotes)

    the problem is in quotes.

提交回复
热议问题