Jump to content

[SOLVED] Mysql with AND / OR


Halisco

Recommended Posts

I am trying to get results for the following.

 

This satatement works:

 $result=mysql_db_query($base,"select * from ".$basesites."  WHERE Field1 LIKE '%$SearchField1%' OR Field2 LIKE '%$SearchField2%' ORDER BY Field1" ,$link);

 

This statement Doesn't work:

 $result=mysql_db_query($base,"select * from ".$basesites."  WHERE Field1 LIKE '%$SearchField1%' OR Field2 LIKE '%$SearchField2%' AND Field3 LIKE '%$SearchField3%' ORDER BY LastName" ,$link);

 

How do i create a statement that will give me result for either (Field1 OR Field2) AND Field3

Link to comment
https://forums.phpfreaks.com/topic/145217-solved-mysql-with-and-or/
Share on other sites

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.