Jump to content

[SOLVED] Not updating record into MySQL


suttercain

Recommended Posts

Hi everyone,

 

I am attemting to update a MySQL record and after I hit the submit button from the update form  I get a blank white page. I have error reporting on, but still nothing.

 

Here is the code:

<?php error_reporting(E_ALL); ?>
<html>
<head>
<title>Edit Canada Request Information</title>
</head>
<body>
Hello!!!
<?php
if (isset($_POST)) {
$ud_record_id = $_POST['ud_record_id'];
$ud_first_name = $_POST['ud_first_name']; 
$ud_last_name = $_POST['ud_last_name']; 
$ud_street = $_POST['ud_street']; 
$ud_city = $_POST['ud_city']; 
$ud_state = $_POST['ud_state']; 
$ud_zip_code = $_POST['ud_zip_code']; 
$ud_vehicle_make = $_POST['ud_vehicle_make']; 
$ud_vehicle_year = $_POST['ud_vehicle_year']; 
$ud_vehicle_model = $_POST['ud_vehicle_model']; 
$ud_vin = $_POST['ud_vin']; 
$letter_sent = date('l F jS, Y');


require ('get_connected.php');

$sql = "UPDATE canada SET 
		first_name = '$ud_first_name', 
		last_name = '$ud_last_name', 
		street = '$ud_street', 
		city = '$ud_city', 
		state = '$ud_state', 
		zip_code = '$ud_zip_code', 
		vehicle_make = '$ud_vehicle_make',
		vehicle_year = '$ud_vehicle_year',
		vehicle_model = '$ud_vehicle_model',
		vin = '$ud_vin',
		letter_sent = '$letter_sent'
		WHERE record_id = '$ud_record_id'";
mysql_query($sql) OR die(mysql_error());
}

if (isset($ud_record_id)) {
echo "The record is set.";
} else {
echo "The record is not set.";

?>
</body>
</html>

 

Anyone know why it's blank? Thanks!!

Link to comment
Share on other sites

Yes, what is causing the problems is your error settings.

The ONLY time the page goes blank is if theres a parse error, or other type of error and you have the error settings cut off.

adjust it at the top of the page using error_reporting.

If not, then use htaccess, or alter the ini file.

Link to comment
Share on other sites

Thanks guys. That fixed that problem. My question is now... why it isn't it updating the record? I am not getting any error from the $sql query...

 

<?php error_reporting(E_ALL); ?>
<?php
if (isset($_POST)) {
$ud_record_id = $_POST['ud_record_id'];
$ud_first_name = $_POST['ud_first_name']; 
$ud_last_name = $_POST['ud_last_name']; 
$ud_street = $_POST['ud_street']; 
$ud_city = $_POST['ud_city']; 
$ud_state = $_POST['ud_state']; 
$ud_zip_code = $_POST['ud_zip_code']; 
$ud_vehicle_make = $_POST['ud_vehicle_make']; 
$ud_vehicle_year = $_POST['ud_vehicle_year']; 
$ud_vehicle_model = $_POST['ud_vehicle_model']; 
$ud_vin = $_POST['ud_vin']; 
$letter_sent = date('l F jS, Y');


require ('get_connected.php');

$sql = "UPDATE canada SET 
		first_name = '$ud_first_name', 
		last_name = '$ud_last_name', 
		street = '$ud_street', 
		city = '$ud_city', 
		state = '$ud_state', 
		zip_code = '$ud_zip_code', 
		vehicle_make = '$ud_vehicle_make',
		vehicle_year = '$ud_vehicle_year',
		vehicle_model = '$ud_vehicle_model',
		vin = '$ud_vin',
		letter_sent = '$letter_sent'
		WHERE record_id = '$ud_record_id'";
mysql_query($sql) OR die(mysql_error());
}
?>

Link to comment
Share on other sites

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.