Re: Thoughts on real cause of a 500 internal server error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, feel silly now.

As soon as I implemented real error handling, it told me that the $dbPassword variable was undefined, and thus the connection to the mySQL server while it had gone through, was not allowed to actual render a result set as such, due to permissions.

Seems that while have been making an effort to retype some pieces of code to make sure remember/learn all details, I should occasionally that have retyped correct string values - should have made use of $dbPass instead of $dbPassword, since that's the variable value that have actually assigned in the included dbInc.php file.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <jacobk@xxxxxxxxxxxxxx>
To: <php-windows@xxxxxxxxxxxxx>
Sent: Monday, March 12, 2012 3:50 PM
Subject:  Thoughts on real cause of a 500 internal server error


In the below bit of code, that last line causes server to bomb out with an HTTP 500 Internal Server Error, but, for example if I comment out that line, and get it to echo the $sql string value, that I can quite happily get it to run via a form of query analyzer, returning a record set, etc., but really just wondering what could be causing this issue, when similar code is running quite happily on various other pages in same site, using same include files for things like host name, database values, etc. etc.

Code snippet:
/* there's not much above this aside from setting the values of a couple of string variables to possibly populated in code below to give them sort of default values, and a check of $_SESSION variables to make sure they're set */

require("dbInc.php"); //this populates variables to be used for connection
$sql = sprintf("select vEmail, vName from %s where id = %s;", $tableUsers, $_SESSION["id"]);
$mysqliObj = new mysqli($dbHost, $dbUser, $dbPassword, $dbDB);
$res = $mysqliObj->query($sql);
$res->data_seek(0); //this is the line of code that causes page to bomb out completely

/* there is otherwise code below here that carries on with calling fetch_assoc() against $res object, sets variable values, closes connection, etc. etc. */

Will also try implementing more descriptive error management to see if can get more info from server itself, but it currently literally just renders the message about HTTP 500 internal server error.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux