Basically, I can't seem to get the error to display when I use the die() function.
When the page fails and this die is called:
$info = mysql_query($query_info, $connBarHopper) or die("Could not get info query".mysql_error());
The only thing that is displayed is "Could not get info query" without any description of the error. Since the phrase is displayed, I know that the query failed and called the die, but why isn't the error being displayed?
Here's the long verion of the problem with a little background: I've been having a problem with a page that keeps crashing (not a 404 error, it just loads a completely white page) after it makes a mysql query... sometimes. Other times, the whole page loads fine. I put in some echoes before and after the first query (there are 3 total queries), and the echoes before the query always display while the echoes after only display if the whole page loads. This led me to believe that it was a problem with the query, but after reading some other threads, I'm not so sure.
Recently, I've tried to change the error reporting functions using ini_set, even though display_errors is set to ON and error_reporting is set to 2039. Here's the code at the beginning of my page
ini_set('display_errors', 1);
ini_set('error_reporting',E_ALL);
$thisid = $_SESSION['id'];
$userid = $_GET['id'];
$query_info = "SELECT email, first_name, last_name FROM userprofiles WHERE `id` = '$userid'";
$info = mysql_query($query_info, $connBarHopper) or die("Could not get info query".mysql_error());
$row_info = mysql_fetch_assoc($info);
echo "After the query";
The echo "After the query" only displays if the whole page loads. The real problem that I'm having is that if the page fails to load (and loads a white, blank page), then only the words "Could not get info query" is displayed without any form of error after it.
Before I added the string inside the die, I always just thought I wasn't having any errors, but now I'm pretty worried since its obvious none of them have been displayed. Does anyone know why my errors aren't showing up when the queries die? Obviously, I don't know a lot about error reporting.