suttercain Posted April 20, 2007 Share Posted April 20, 2007 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!! Quote Link to comment https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/ Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2007 Share Posted April 20, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/#findComment-234165 Share on other sites More sharing options...
davidz Posted April 20, 2007 Share Posted April 20, 2007 Looks like your missing a } if (isset($ud_record_id)) { echo "The record is set."; } else { echo "The record is not set."; Should be if (isset($ud_record_id)) { echo "The record is set."; } else { echo "The record is not set."; } Quote Link to comment https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/#findComment-234166 Share on other sites More sharing options...
suttercain Posted April 20, 2007 Author Share Posted April 20, 2007 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()); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/#findComment-234173 Share on other sites More sharing options...
suttercain Posted April 20, 2007 Author Share Posted April 20, 2007 Got it. Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/47919-solved-not-updating-record-into-mysql/#findComment-234175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.