i fetch MySql result using this PHP function:
function fetcharray ($query_id)
{
if(!$query_id)
{
$query_id = $this->query_res;
}
if($query_id)
{
$this->q_array[$query_id] = @mysql_fetch_array($query_id,MYSQL_ASSOC); // LINE 124
return $this->q_array[$query_id]; //LINE 125
}
else
{
return false;
}
}
Now, I move to PHP 5.5 and see This error:
Strict Standards: Resource ID#73 used as offset, casting to integer (73) in domain.com/includes/functions/db.php on line 124
Strict Standards: Resource ID#73 used as offset, casting to integer (73) in domain.com/includes/functions/db.php on line 125
How I can Fix this error?
You're using a resource, which is not an integer, as an integer. Even though you see a number when you inspect it, it actually is not a true integer. It's a resource ID that is associated with your MySQL connection.
If you want to use it as an integer I think you can cast it to an integer before using it (I never actually tried it).
if($query_id)
{
$id = (int) $query_id;
$this->q_array[$id] = @mysql_fetch_array($query_id,MYSQL_ASSOC); // LINE 124
return $this->q_array[$id]; //LINE 125
}
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