fireice87 Posted July 27, 2010 Share Posted July 27, 2010 Just having an annoying moment where i really cant see the problem so any help would be great I have a form that passes to reg_confirm.php that has the insert script i can echo out the variables on this page. heres the code <?php require('functionlist.php'); dbconnect(); $submitted = date('j F Y hA'); /* echo $_POST[title]; echo $_POST[first_name]; echo $_POST[email]; echo $_POST[first_name]; echo $_POST[telephone]; echo $_POST[pcode]; echo $_POST[time_call]; */ $sql = "INSERT INTO `training` (`tr_title` ,`tr_firstnames` ,`tr_email` ,`tr_telephone` , `tr_time` ,`tr_postcode`,`tr_date` ) VALUES (\"$_POST[title]\",\"$_POST[first_name]\",\"$_POST[email]\", \"$_POST[telephone]\", \"$_POST[time_call]\", \"$_POST[pcode]\",\"$submitted\");"; #Create Query $result= mysql_query($sql, $conn ) or die(mysql_error()); #Run query heres a copy and paste of table fields from phpmyadmin tr_title tr_firstnames tr_email tr_telephone tr_time tr_postcode tr_date Thanks alot edit forgot to post the connection! <?php function dbconnect() { global $conn, $db; $conn = @mysql_connect( "**", "**", "**") or die ("could not connect to mysql"); #Connect to mysql $db = @mysql_select_db( "**", $conn ) or die ("Could not select database"); #select database } ?> Quote Link to comment https://forums.phpfreaks.com/topic/209031-quick-question-cant-spot-issue-with-insert-script/ Share on other sites More sharing options...
systemick Posted July 27, 2010 Share Posted July 27, 2010 What error do you see when you run the script? Quote Link to comment https://forums.phpfreaks.com/topic/209031-quick-question-cant-spot-issue-with-insert-script/#findComment-1091816 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.