Jump to content

code not working, no errors as to why


webguync

Recommended Posts

anyone know why this code would just display as a blank white page? It should at least give me an error, I would hope.

<?php
ini_set("display_errors","1");
error_reporting(E_ALL);
session_start();
$con = mysql_connect("localhost","uname","pw") or die('Could not connect: ' . mysql_error());
mysql_select_db("DBName") or die(mysql_error());
$_SESSION['user_id'] = $user_id;
//DELETE QUERY TO SELECT RECORD TO DELETE BASED ON LOGIN INFO.
$query_delete = "DELETE FROM Caris_log_April2010 WHERE user_id = $user_id AND Caris_roster_March2010.user_id = $user_id";
echo $query; //for debugging test
$result_delete = mysql_query($query_delete) or trigger_error('Query failed: ' .mysql_error());
if ($result_delete)
{
echo "Delete Successful"
}// end if
else
{
echo "Failed"
} //end else
?>

Link to comment
https://forums.phpfreaks.com/topic/199165-code-not-working-no-errors-as-to-why/
Share on other sites

Your code contains a fatal parse error -

Parse error: syntax error, unexpected '}', expecting ',' or ';' in your_file.php on line 15

 

Please develop and debug php code on a system where error_reporting is set to E_ALL and display_errors is set to ON in your master php.ini so that php will report and display all the errors it detects.

 

Putting the two lines of code in your code that sets the error_reporting/display_errors settings won't show fatal parse errors because you code is never executed to cause those two settings to take effect. The cases where you have seen it suggested to put those two lines of code in your code for debugging purposes were when code appeared to be executing but not producing expected results.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.