Only 25 records for each ID?!?
Posted: Wed Apr 04, 2007 4:34 am
feyd | Please use
Is this possible in PHP?
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Is it possible to only collect 25 records for each ID? When I insert the 26'th record for that ID I want to get rid of the oldest record for that ID? I did it once in ASP:queasy: and it looked like this:
[syntax="asp"] strSQL = "SELECT * FROM list WHERE ID=1"
rs.open strSQL, conn, 1 , 1
If rs.recordcount > 24 Then
strSQL = "DELETE * FROM list WHERE Date IN(SELECT TOP 1 Date FROM list ORDER BY Date)"
conn.Execute (strSQL)
End If
strSQL = "INSERT INTO list ( ID, Point, Name ) VALUES (" & _
"'" & sqllize(Request("player1ID")) & "', '" & sqllize(Request("player1Point")) & "', '" & _
sqllize(Request("Player1Name")) & "')"
conn.Execute (strSQL)
rs.Close feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]