www.webdeveloper.com
Results 1 to 10 of 10

Thread: multiple field select in php crashes apache

  1. #1
    Join Date
    Nov 2010
    Posts
    22

    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!

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Define "crashes apache."
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  3. #3
    Join Date
    Nov 2010
    Posts
    22

    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.

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    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.
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  5. #5
    Join Date
    Nov 2010
    Posts
    22

    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.

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    As a temporary solution, try using the standard mysql library. A bug in mysqli is causing the crash:
    Fault Module Name: php_mysqli.dll
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  7. #7
    Join Date
    Jan 2009
    Posts
    3,346
    Did you recently perform any upgrades? Sometimes left over dll files from older versions can conflict if an install/upgrade wasn't completed properly.

  8. #8
    Join Date
    Nov 2010
    Posts
    22

    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.

  9. #9
    Join Date
    Jan 2009
    Posts
    3,346
    Faulty install of mysql perhaps?

  10. #10
    Join Date
    Nov 2010
    Posts
    22

    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
  •  
HTML5 Development Center



Recent Articles