raybowls Posted January 15, 2009 Share Posted January 15, 2009 Fairly new to php/mysql - I am trying to set up a form to insert several records into mysql - I can get my form to do single entries but do not know how to convert it to do multi entries. Using these codes: <html><body> <form action="process.php" method="post"> Number: <input type="text" name="num" /> Shots Scores: <input type="text" name="shots_for" /> Shots Against: <input type="text" name="shots_against" /> Points : <input type="text" name="points" /> <input name="submit" type="submit" value="submit"> </form> </body></html> _________________________________________________________ <html><body> <?php $num=$_POST['num']; $shots_for=$_POST['shots_for']; $shots_against=$_POST['shots_against']; $points=$_POST['points']; mysql_connect("localhost", "root", "******") or die(mysql_error()); mysql_select_db("bowls") or die(mysql_error()); mysql_query("INSERT INTO `results` VALUES ('$num', '$shots_for', '$shots_against', '$points')"); Print "Your information has been successfully added to the database."; ?> </body></html> Only being used on localhost - a long time before going live Trying to learn php/mysql to build a web site for a local club I belong to. Any help much appreciated Ray Link to comment https://forums.phpfreaks.com/topic/140970-phpmysql-form-multi-records/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.