multiple field select in php crashes apache
$result = mysqli_query($link, 'SELECT * FROM obit_table') or die("SELECT Error: ".mysqli_error());
echo ('Here we are!');
if (!$result)
{
$error = 'Error fetching spencer records: ' . mysqli_error($link);
include 'error.html.php';
exit();
}
while ($row = mysqli_fetch_array($result))
{
$obits[] = array('id' => $row['id'], 'fname' => $row['fname']);
}
The above code will crash apache, however if i use the following it will run.
$result = mysqli_query($link, 'SELECT fname FROM obit_table') or die("SELECT Error: ".mysqli_error());
echo ('Here we are!');
if (!$result)
{
$error = 'Error fetching spencer records: ' . mysqli_error($link);
include 'error.html.php';
exit();
}
while ($row = mysqli_fetch_array($result))
{
$obits[] = array('id' => $row['id'], 'fname' => $row['fname']);
}
Or could it be the while statement that's causing the problem? Help!
Crash Error Message
Problem signature:
Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.2.17.0
Application Timestamp: 4cbbe9e8
Fault Module Name: php_mysqli.dll
Fault Module Version: 5.2.11.11
Fault Module Timestamp: 4ab13117
Exception Code: c0000005
Exception Offset: 00002b5b
OS Version: 6.0.6002.2.2.0.768.3
Locale ID: 1033
Additional Information 1: 1ebb
Additional Information 2: 11c374033464144b8cd059f9d36f5d12
Additional Information 3: 87fb
Additional Information 4: f3c8a402b043b020ac888dd944efb5ec
Apache stops running.
Whether it's the variation in the query, the while loop, or anything else, apache shouldn't just be crashing. If you're the sysadmin on the box/server, I'd check for updates before trying to "debug" this.
Thanks for help.
Thank you for you advice. I will check for all updates to mysql and php. I am using the latest version of apache 2.2.17.
As a temporary solution, try using the standard mysql library. A bug in mysqli is causing the crash:
Fault Module Name: php_mysqli.dll
Did you recently perform any upgrades? Sometimes left over dll files from older versions can conflict if an install/upgrade wasn't completed properly.
Tried mysql with same results
I did try the mysql, but received the same results. I am able to do the select * in the command prompt without any problems.
Faulty install of mysql perhaps?
Figured it out from good advice.
I went back to ground zero. Reinstalled MySql, Apache, and PHP. Started Apache service and now I can do a "SELECT * FROM obit_table" and see all the fields. Still don't understand why I was able to get one field and not multiple. Odd to say the least.
Thanks again for all reply's.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks