Answer the question
In order to leave comments, you need to log in
How can I add a record to the top of the database?
Here is my code for adding a topic to the forum.
$query = mysqli_query($connection, "INSERT INTO `forum`(`title`, `description`, `category`, `author`, `price`) VALUES ('$title','$description','$category', '$author', '$price')");
Answer the question
In order to leave comments, you need to log in
Perhaps you need to make sure that the questions are sorted in descending order of id in the database....
the very concepts of "database start" and "database end" are absolutely wrong. Data in most relational databases is stored in an unsorted form. The DBMS itself decides "where in the table" to insert the record.
As colleagues have already correctly said above, it is correct to add the phrase ORDER BY <sort field> <sort order - ASC|DESC> to the query that displays your data in the user interface.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question