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

"Jacob Kruger" <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <D633144777DB4F2C85EEC793A872F4AD@jakesPC>
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" <[email protected]>
To: <[email protected]>
Sent: Monday, March 12, 2012 3:50 PM
Subject: [PHP-WIN] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.