vnichol Posted December 7, 2010 Share Posted December 7, 2010 I know this is very simple, but... Any way here is the code for my form, but it doesn't post to my database and there are no errors shown. Any ideas? thanks <? include("include/session.php");?> <? include('include/headder_login.php'); ?> <h1>Event Information : <? echo $session->username; ?></h1> <form> <form action="protimes.php" method="post" name="event information"> <input name="id" type="text" value=""> <input name="name" type="number" value="name" size="30"> <select name="event"> <option value="1">50 Front</option> <option value="2">50 Back</option> <option value="3">100 Front</option> </select> <input name="time" type="time" value"time" > <input name="date" type="date" value="date"> <input name="submit" type="button" value="submit" align="right"> <input type="reset" name="reset" value="reset"aligh="right"> </form> protimes.php file $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('$_POST[id]','$_POST[name]','$_POST[event]','$_POST[time]','$_POST[date')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } echo "1 record added"; Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted December 7, 2010 Share Posted December 7, 2010 try $sql="INSERT INTO `cbcrusta_test3`.`info` ( `id` , `name` , `event` , `time` , `date` ) VALUES ('".$_POST['id']."','".$_POST['name']."','".$_POST['event']."','".$_POST['time']."','".$_POST['date']."') Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 7, 2010 Share Posted December 7, 2010 You don't have display errors = On, if you did you'd get a parse error on the line with the query string. VALUES ( '{$_POST['id']}', '{$_POST['name']}', '{$_POST['event']}', '{$_POST['time']}', '{$_POST['date']}' )"; Quote Link to comment Share on other sites More sharing options...
vnichol Posted December 8, 2010 Author Share Posted December 8, 2010 this is still not working, but I am guessing that as well as the phrase error, there must be errors created by the includes <? include("include/session.php"); // keeps track of login include('include/headder_login.php'); ?>// gives page menu because the form doesn't even seem to get to the protimes page which should do the processing of the post data. If you have any other ideas thank you very much, if not I will keep looking.... again thanks for the help. vincent. Quote Link to comment Share on other sites More sharing options...
vnichol Posted December 9, 2010 Author Share Posted December 9, 2010 Thank you all for the help, it was the includes and a , that ended up being the problem. Again thanks for the help. vincent. Quote Link to comment 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.