Jump to content

More Then 1 AND in sql causing problems????


AbydosGater

Recommended Posts

Hi, in my query...

$query_reviews =  "SELECT * FROM reviews WHERE epnumber = '$ep' AND auth = 1"


That works fine, without problems, but if i add another AND in there it gives me errors

How do i have more then one And, so that it only pulls where epnumber = $ep and auth = 1 and say author = 2, how would i do this??

Please help
Link to comment
https://forums.phpfreaks.com/topic/26237-more-then-1-and-in-sql-causing-problems/
Share on other sites

This should be posted in the MySql section.

However, several AND's should be ok, what error do you get?

[code]
<?php

$query_reviews = mysql_query("SELECT * FROM reviews WHERE epnumber = '$ep' AND auth = 1 AND author = 2") or die(mysql_error());

?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.