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 Quote Link to comment 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')"; ?> Quote Link to comment 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 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.