Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.