Where and what is the error ? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select column from this_table where email=example@example.com limit 0, 10' at line 1 $hid="select column from this_table where email=".$_SESSION['email']; $hid2="select * from that_table where status1=1 and status2=1 and status1<>3 and id not in $hid limit $start, $max"; PHP: in status1<>3 i used both status1<>3 status1!=3 PHP: but no luck $start, $max defined to use limit on result display on a page any help
select column from this_table where email=example@example.com limit 0, 10; Add single quotes around the email value: select column from this_table where email='example@example.com' limit 0, 10;