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
https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/
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.

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());
}
?>

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.