Hey i have the same question. My code:hey,
just wondering....i have a databse of my record collection. its a simple one designed only so i can learn to use mysql with php. my question here regards sql. is there are way to search the whole table or several tables (the whole database) for a search phrase entered by the user? the way i understand it now, i will have to provide a drop down menu or similar to allow the user to decide what to search for, a album name, band name or year (take a look at http://www.ultimate-guitar.com tab search) and then use a sql query based on that.
any help would be appreciated.
tnx
kumar
Code: Select all
switch ($dop)
{
case "submit":
if ($topic!="-------")
{
$engine=mysql_query("select * from $topic where $category like '$what%'") or die(mysql_error());
while ( $swhat=mysql_fetch_array($engine))
{
$sresult=$swhatї"$category"];
ECHO "<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>$sresult</td>
</tr>
</table>";
}
}
}$category is the category of the topic.
$what is the search term.
But when i try to search eg: "hello" in topic "news" category "story"
i get a "There is no column named story". But i know there is one
[Split due to topic hijack -- JAM]