lawrence_dev
asked on
Transitioning to PDO/MySQL. Need help with SELECT statement, Do I have to bind value?
On a select statement without a WHERE clause, do I have to bind anything using PDO?
I am getting the following error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes)
on "$query2->execute();" line.
I am getting the following error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes)
on "$query2->execute();" line.
$query2 = $conn->prepare('SELECT * FROM `download');
// Do I bind a value here?
$query2->execute();
while ($row2 = $query2->fetch(PDO::FETCH_ASSOC))
{
echo $row2['image']."<BR>";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add this to the top of the php page to get any errors reported
error_reporting(E_ALL);
32 MB is rather small for a site, 64 or 128 would be better.
But you are returning a lot of rows - is there a reason?
If you are using a custom php.ini file you should place it in the site root.
error_reporting(E_ALL);
32 MB is rather small for a site, 64 or 128 would be better.
But you are returning a lot of rows - is there a reason?
If you are using a custom php.ini file you should place it in the site root.
I've just noticed a syntax error in your code
Should be (no need for the backticks and you were missing the closing one)
Should be (no need for the backticks and you were missing the closing one)
$query2 = $conn->query('SELECT * FROM download');
ASKER
Thanks Gary for all of your help!! Memory Limit issue with IonCube required for PDO. Fixed it and it is good!
ASKER
Thanks again!
ASKER
I have 17040 rows, None being returned. If I place php.ini in the same folder, PDO stops working for some reason...
Still working on it...