I have simple LIKE %term% query, working on various other scripts. I'm also trying to incorperate it in a bigger project.
I'm running a db on a MMORPG game, for all of it's "shops". I have several "colums" I want the script to look in, such as "shopname, items" and so forth. With multiple Item feilds (30 total).
I'm using this script;
<?PHP
$dbQuery = "select * FROM shops WHERE in1, in2, in3 LIKE '%$term%' ";
$Sresult = mysql_query($dbQuery) or die("Couldn't get file list");
?>
<?php
while($row = mysql_fetch_array($Sresult)){
print "<tr><td align='center' valign='top' bgcolor='#52520F' width='20%' class='shops2'>\n";
print "Shop ID: <span class='dbprice'>$row[id]</span></td>\n";
print "<td align='center' valign='middle' bgcolor='#6E6F47' class='shops2' width='80%'>\n";
print "Shop Name: <a href='shopdb?num=$row[ID]&class=$row[class]'class='shops'>$row[shopname
]</a></td></tr>\n";
}
?>
Obviously "WHERE in1, in2, in3" will not work. What is the correct way to do this? So I can search fields "in1 through in30". And a few others. Any help would be great, thanks!