Thoughts on real cause of a 500 internal server error

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

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 Home]     [PHP Users]     [PHP Install]     [PHP on Windows]     [Programming PHP]     [Kernel Newbies]     [Rice Cooker]     [Home]     [Yosemite News]     [Yosemite Photos]     [PHP Books]

Powered by Linux