|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Insert Multiple Data into a table
I am having difficulties.
Is it possible to Insert multiple data into a database table at one time? an example two columns Beckham Man UTD Owen Liverpool Henry Arsenal Thats what my page looks like. I want to insert all three of them lines into the database in one table. But all it does at the moment is inserts Henry Arsenal it does the last line all the time. Pweese Help |
|
#2
|
|||
|
|||
|
RE: Insert Multiple Data into a table
|
|
#3
|
|||
|
|||
|
RE: Insert Multiple Data into a table
You could also write it as a single insert:
INSERT INTO <table> VALUES ("Beckham","Man UTD"),("Owen","Liverpool"),("Henry","Arsenal"); This type of insert will be faster if you have alot of data to insert. Cheers, Keith. |
|
#4
|
|||
|
|||
|
RE: Insert Multiple Data into a table
Hi,
Because i am getting the details from the database, this makes my problem a little bit difficult. On the page where it displays, Beckham Man UTD, Owen Liverpool, Henry Arsenal. It doesnt actually say there names, the code is echo " <tr> <td>Player</td> <td>Club</td> </tr>"; while ( $row = mysql_fetch_array( $sql_result ) ) { $player = $row["player"]; $club = $row["club"]; echo " <tr> <td>$player</td> <td>$club</td> </tr>"; So this get all the players and clubs in the database. So i dont actually say player club three times, just once. im looking for something like if $num_rows = number of rows in DB then insert * into table How would i go about this please. Cheers |
|
#5
|
|||
|
|||
|
RE: Insert Multiple Data into a table
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Insert Multiple Data into a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|