Possible Duplicate:
PHP: Warning: sort() expects parameter 1 to be array, resource given
Please help,
I get following Error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in......
Here is my Query:
$query = "SELECT ListNumber FROM residential";
$result1 = mysql_query($query);
if (mysql_num_rows($result1) >10){
$difference = mysql_num_rows($result1) - 10;
$myQuery = "SELECT * FROM `residential` ORDER BY `id` LIMIT 10,". $difference;
$result2 = mysql_query($myQuery);
echo $result2;
$replace = str_replace(", "," | ", $result2);
while ($line = mysql_fetch_array($result2, MYSQL_BOTH))
Your query ($myQuery) is failing and therefore not producing a query resource, but instead producing FALSE.
To reveal what your dynamically generated query looks like and reveal the errors, try this:
$result2 = mysql_query($myQuery) or die($myQuery."<br/><br/>".mysql_error());
The error message will guide you to the solution, which from your comment below is related to using ORDER BY on a field that doesn't exist in the table you're SELECTing from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With