php - Deleting a row from a MySQL database -


I have a MySQL table called "Privatemesses", which is called "messaged" by the primary name.

I have a PHP query that wants to delete any line from "privatemessage" where "messageid = $ messageid."

  Remove from 'private message' where 'messageid` = $ messageid  

This is the only raw SQL query: the user input must be considered as valid and avoidable.

For example, messageid is given as an integer primary key in the form of a AUTO_INCREMENT I will run it in PHP ( $ messageid Change by using ( intval () ):

  mysql_query ('Remove from private message' where message `= '. Intval ($ messageid));  

Comments