选择不工作;

i have problem, i can't run select this when I using session in WHERE p.post_by == '{$_SESSION['user_id']}, although i can echo session['user_id'] in screen, if i using WHERE p.post_by <> '{$_SESSION['user_id']} then SELECT working, can you help me?

$sql="SELECT p.id,p.post_convert,p.post_id,p.post_title,p.post_by, p.post_time,p.post_view,p.post_catelogy,
p.post_content,p.post_summary,p.post_picture, c.menu_id,c.menu_title,u.id_user,u.username,u.info 
FROM post p, category c, user u 
WHERE p.post_by = '{$_SESSION['user_id']} ' && p.post_catelogy = c.menu_id  
ORDER BY p.id DESC";

You are using double ==, no need here:

WHERE p.post_by ==  '{$_SESSION['user_id']} '

This should be:

WHERE p.post_by =  '{$_SESSION['user_id']}'

Note that, WHERE p.post_by <> is working because its valid.

Also remove extra space from '{$_SESSION['user_id']} ' it will consider in condition like:

WHERE p.post_by = 'Test ' // which is not equal to 'Test'

Modified Query:

$sql="SELECT p.id,p.post_convert,p.post_id,p.post_title,p.post_by, p.post_time,p.post_view,p.post_catelogy,
p.post_content,p.post_summary,p.post_picture, c.menu_id,c.menu_title,u.id_user,u.username,u.info 
FROM post p, category c, user u 
WHERE p.post_by = '{$_SESSION['user_id']}' && p.post_catelogy = c.menu_id  
ORDER BY p.id DESC";

try to concatenate the session id:

where p.post_by = '".$_SESSION['user_id']."'