I am creating a message board for a website i have created i am using mysql and php.
i have the following database(excel file)
Here is my thought process
1. id - auto increment to order by newest created
2. original_id - copies the id value of the first message created and continues to be redundant until the message is deleted.
3. status -
a. active - normal message
b. deleted - message has been moved to trash
c. inactive - message has been completely deleted
a. read - message has not been read
b. unread - message has been read
5. saved - either empty or 'saved'
a. multiple - the message is address to a group (3 or more people)
b. private - 2 people
7. sender / recipient - the sender message is copied for each person in the message including themselves to make separate copies so each user can apply their own settings to the mysql row.
8. composted_ date - date created
9. subject /message - contents of message
the sql statements is as follows
$database='messages' ->name of my database
$sp_query3 ="SELECT * FROM ".$database." WHERE status='active' AND ";
' AND recipient='".$user."' GROUP BY original_id ORDER BY id DESC";
$sp_res3 = mysqli_query($link, $sp_query3) or die( mysqli_error($link));
when i run this query it groups the messages fine however it does not order by id whats wrong?
thanks in advance