vikela Posted April 28, 2009 Share Posted April 28, 2009 i have been trying to insert the following into mysql but no joy.the error i am getting is string(0) "" if($_SERVER['REQUEST_METHOD'] == "post") { $month=$_POST['month']; $day=$_POST['day']; $year=$_POST['year']; $dob = $year.'-'.$month.'-'.$day; $gender = $_POST['gender']; $race = $_POST['race']; $segment = $_POST['segment']; $region = $_POST['region']; mysql_query("INSERT INTO PanelMember (date_of_birth, gender, race, segment, region) VALUES('$dob','$gender','$race','$segment','$region' ")or die(mysql_error()); echo "Member Added Inserted!.."; } Link to comment https://forums.phpfreaks.com/topic/155948-why-cant-this-be-inserted/ Share on other sites More sharing options...
mtoynbee Posted April 28, 2009 Share Posted April 28, 2009 No closing ) after region Link to comment https://forums.phpfreaks.com/topic/155948-why-cant-this-be-inserted/#findComment-820918 Share on other sites More sharing options...
nadeemshafi9 Posted April 28, 2009 Share Posted April 28, 2009 what is the mysql error ? do you have connection defined ? what is teh database table schema ? Link to comment https://forums.phpfreaks.com/topic/155948-why-cant-this-be-inserted/#findComment-820919 Share on other sites More sharing options...
killah Posted April 28, 2009 Share Posted April 28, 2009 if($_SERVER['REQUEST_METHOD'] == "post") { $month=$_POST['month']; $day=$_POST['day']; $year=$_POST['year']; $dob = $year.'-'.$month.'-'.$day; $gender = $_POST['gender']; $race = $_POST['race']; $segment = $_POST['segment']; $region = $_POST['region']; mysql_query("INSERT INTO PanelMember (date_of_birth, gender, race, segment, region) VALUES('$dob','$gender','$race','$segment','$region')")or die(mysql_error()); echo "Member Added Inserted!.."; } Link to comment https://forums.phpfreaks.com/topic/155948-why-cant-this-be-inserted/#findComment-820925 Share on other sites More sharing options...
nadeemshafi9 Posted April 28, 2009 Share Posted April 28, 2009 wth did you change anything ? i see it now one ) to close teh values Link to comment https://forums.phpfreaks.com/topic/155948-why-cant-this-be-inserted/#findComment-820929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.