Hello.
Just a brief query regarding mysql and php.
I'm currently planning, looking into a simple method of searching a database table, and creating list 10 most clicked links. (ie creating a top 10).
I've done the search, created the temporary array, then inserted the array in a separate database table.
All I'd like to know how do I find out the primary key/id of the first record in the table, then I can delete it once the next record has been inserted?
This would leave only 2 or 3 records in the table at any one time.
$last_id = $conn->lastInsertId(); would fetch the last record in the table.
Would $first_id = $conn->firstInsertId(); show the first record, assuming record 1 has been deleted.
Thank You.
Just a brief query regarding mysql and php.
I'm currently planning, looking into a simple method of searching a database table, and creating list 10 most clicked links. (ie creating a top 10).
I've done the search, created the temporary array, then inserted the array in a separate database table.
All I'd like to know how do I find out the primary key/id of the first record in the table, then I can delete it once the next record has been inserted?
This would leave only 2 or 3 records in the table at any one time.
$last_id = $conn->lastInsertId(); would fetch the last record in the table.
Would $first_id = $conn->firstInsertId(); show the first record, assuming record 1 has been deleted.
Thank You.