Thoughts on real cause of a 500 internal server error
| From: | Jacob Kruger | Date: | Mon, 12 Mar 2012 13:50:19 +0000 |
| Subject: | Thoughts on real cause of a 500 internal server error | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-30800@lists.php.net to get a copy of this message | ||
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...'