search query problem
| From: | Ahmed | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | search query problem | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-29488@lists.php.net to get a copy of this message | ||
hi
i am making a simple search form
how can i search more than one table for the same word
i used a query and it failed
here it is
@ $db = mysql_connect("localhost");
mysql_select_db("egycds");
$test_tr = mysql_query("select newdvd.date, newpcgames.date, olddvd.date,
screener.date,
newdvd.type, newpcgames.type, olddvd.type, screener.type,
newdvd.name, newpcgames.name, olddvd.name, screener.name,
newdvd.cds, newpcgames.cds, olddvd.cds, screener.cds,
newdvd.downloader, newpcgames.downloader, olddvd.downloader, screener
downloader, where newdvd.name like '%".$word."%'
or newpcgames.name like '%".$word."%' or olddvd.name like
'%".$word."%' or
screener.name like '%".$word."%'");
while ($record=mysql_fetch_array($test_tr)){
echo "
<TR onmouseover=\"this.bgColor='000000'\"
onmouseout=\"this.bgColor='475674'\" bgColor=#475674>
<TD width=75>
<DIV align=center><FONT
color=#ffffff>";
echo stripslashes($record['date']) ;
echo "</FONT></DIV></TD>
<TD width=50>
<DIV align=left><FONT color=white>";
echo stripslashes($record['type']) ;
echo "</FONT></DIV></TD>
<TD><FONT
color=#ffffff><strong>  
<A
href=\"";
echo stripslashes($record['link']);
echo "\" target=_new1>";
echo stripslashes($record['name']);
echo
"</A> </strong></FONT></TD>
<TD width=40>
<DIV align=left><FONT color=#ffffff><A
href=\"";
echo stripslashes($record['subtitle']);
echo "\">";
echo stripslashes($record['cds']);
echo "</FONT></DIV></TD>
<TD width=50>
<DIV align=left><FONT color=#ffffff><A
href=\"";
echo stripslashes($record['downloaderlink'])
echo "\">";
echo stripslashes($record['downloader']);
echo "</A></FONT></DIV></TD>
</TR> ";
}
echo "</TBODY></TABLE>";
can anyone help please.