Possible Duplicate:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
function arr($string)
{
$tank5 = "SELECT url FROM `db`.`tank` WHERE url LIKE {$string}";
$result5 = mysql_query($tank5);
if (!$result5) {
die('Invalid query: ' . mysql_error());
}
$parts2 = array();
while ($p = mysql_fetch_array($result5)) {
$parts2[] = $p['url'];
}
// return the array created.
return $parts2;
}
$array5 = arr('lol.com');
print_r($array5);
Why don't the above code work. The error I'm getting isWarning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /usr/local/...
so I guess it's not database connection problem. Any idea?