My question is about deleting multiple records (selected checkboxes).
I use this:
mysql_query('DELETE FROM instant messages WHERE msg_id IN ('. implode(', ', $_POST['msg_id']).')');
It works OK, but it's important to check that users can delete only their own instant messages but not messages of other people.
So, I need something like this:
mysql_query('DELETE FROM instant messages WHERE uname='$username' and msg_id IN ('. implode(', ', $_POST['msg_id']).')');
It doesn't work - I am getting parse errors. Any ideas?
Thank you.