Add, delete, modify mysql data with php

From thelinuxwiki
Revision as of 22:19, 25 February 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

insert example 1:

 $query = "INSERT INTO ineedlist VALUES (,'$name','$type','$user','$strikethrough')";
 mysql_query($query);

change example 1:

         $update=mysql_query("UPDATE ineedlist SET strikethrough='1' WHERE id='$astrikethrough[$i]'") 
         or die (mysql_error());

delete example 1:

         $update=mysql_query("DELETE FROM dbasename WHERE var='value'") 
         or die (mysql_error());

delete example 2:

         $update=mysql_query("DELETE FROM ineedlist WHERE id='$astrikethrough[$i]'") 
         or die (mysql_error());