Dynamic SQL + result resource error
| From: | Mark Gordon | Date: | Sun, 08 Jul 2001 23:54:00 +0000 |
| Subject: | Dynamic SQL + result resource error | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10156@lists.php.net to get a copy of this message | ||
Why is this code generating an error when it outputs a
valid SQL statement? (there are no parse errors)
//$find is text box input
$wordsarray = explode(" ",$find);
$sql = "SELECT bandname FROM bands WHERE (bandname
LIKE ";
$i = 0;
while ($i < count($wordsarray))
{
$word = current($wordsarray);
next($wordsarray);
$sql=$sql."$word)";
$i++;
}
print "$sql<hr>";
while ($myrow=mysql_fetch_row($sql))
{
print "$myrow[0],<p>";
}
=====
Mark
eyesyte@yahoo.com
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/