mtgriffiths Posted March 1, 2008 Share Posted March 1, 2008 Hey all, I have a problem regarding Inserting. I have a form that posts over the following information: League Team1 Score1 Team2 Score2 Week My table is structure as follows: Team_ID League Goals Week. As there are two teams and they both need to be inserted into the database is there anyway of doing this with one insert query. The post data is carried accross from the previous page so i can use that. Thanks in advance Matthew Link to comment https://forums.phpfreaks.com/topic/93897-inserting/ Share on other sites More sharing options...
soycharliente Posted March 1, 2008 Share Posted March 1, 2008 Use a comma to insert another set of values following the first. <?php $sql = "INSERT INTO table VALUES ('$team1', '$league', '$score1', '$week'), ('$team2', '$league', '$score2', '$week')"; ?> Link to comment https://forums.phpfreaks.com/topic/93897-inserting/#findComment-481136 Share on other sites More sharing options...
mtgriffiths Posted March 1, 2008 Author Share Posted March 1, 2008 Thanks alot. That worked great Now to find the next place i get difficulties Link to comment https://forums.phpfreaks.com/topic/93897-inserting/#findComment-481205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.