Greetings.
I have a page that is accessed trough:
http://foo.com/search.php?kind=poetry&term=foobar
and the following code to handle it:
if ($kind = "poetry")
{
$query = mysql_query( "SELECT DISTINCT id, title FROM poetry WHERE title LIKE '%$term%'",$dbcnx);
}
elseif ($tipo = "poets")
{
$query = mysql_query( "SELECT DISTINCT id, name FROM poets WHERE name LIKE '%$term%'",$dbcnx);
}
if ($myrow = mysql_fetch_row($query))
{
do
{
printf("<tr><td><font face=\"verdana\"><a href=\"detail_result.php?result=%s&tipo=$kind\">%s</a></font></td></tr>",$myrow[0],$myrow[1]);
}
while ($myrow = mysql_fetch_row($query));
}
else
{
print("<tr><td><font face=\"verdana\">No result found.</font></td></tr>");
}
mysql_close($dbcnx);
Well, if kind = poetry it works, but if kind=poets it didn't... The strange thing is I've tested the query directly into MySQL and it worked fine.
Can anyone tell me what's going on here?
TIA,
Er Galvão Abbott