I have written the query below to insert data into a table.
The query runs, I get no errors but no data is inserted.
Any suggestions as to my error(s) greatly appreciated
TIA
Nigel.
******************************************************
$result = mysql_query("SELECT DISTINCT Teams.Team FROM Teams"
while ($row=mysql_fetch_assoc($result)) {
$query = mysql_query("INSERT INTO seedtmp3(TRN,Team,Fastest_Time,Venue)
SELECT Ttimes.TRN, Teams.Team, Ttimes.Fastest_Time, Venues.Venue FROM Teams
LEFT JOIN Ttimes ON Teams.TRN=Ttimes.TRN
LEFT JOIN Venues ON Ttimes.Tournament_ID=Venues.Tournament_ID
WHERE Team=".$row['Team']."
ORDER BY Ttimes.Fastest_Time DESC
LIMIT 5"
}
mysql_free_result($result);
The query runs, I get no errors but no data is inserted.
Any suggestions as to my error(s) greatly appreciated
TIA
Nigel.
******************************************************
$result = mysql_query("SELECT DISTINCT Teams.Team FROM Teams"
while ($row=mysql_fetch_assoc($result)) {
$query = mysql_query("INSERT INTO seedtmp3(TRN,Team,Fastest_Time,Venue)
SELECT Ttimes.TRN, Teams.Team, Ttimes.Fastest_Time, Venues.Venue FROM Teams
LEFT JOIN Ttimes ON Teams.TRN=Ttimes.TRN
LEFT JOIN Venues ON Ttimes.Tournament_ID=Venues.Tournament_ID
WHERE Team=".$row['Team']."
ORDER BY Ttimes.Fastest_Time DESC
LIMIT 5"
}
mysql_free_result($result);