Recommended Answers
Jump to Postnot familiar with php but i think you need to put in an if clause on the php side that goes something like
if (variable = null)
select * from mytablename
else select * from mytablename where mycolumnname = variable
Jump to Postchange it to
$query = "SELECT * FROM databasename WHERE columnname2 in ('city1', 'city2', 'city3', 'city4') AND (columnname1 = '2005')or add parentheses in the right spot
$query = "SELECT * FROM databasename WHERE ( (columnname2 = 'city1') OR (columnname2 = 'city2') OR (columnname2 = 'city3') OR (columnname2 = …
Jump to Postlet's say your are looking for business named General Hardware. But you aren't sure if the name is General Hardware or General Tool Shop or something like that.
What you want isselect * from tblBusinesses where businessName like '%General%'
Is that what you are looking for?
All 12 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.