PDA

View Full Version : Please help with a command



nubian
May 25th, 2008, 02:06 PM
i currently have this in my php file.



mysql_query("UPDATE inventory SET id_num ='$id_num' WHERE id_num ='$id_num'");
mysql_query("UPDATE inventory SET id_asset ='$id_asset' WHERE id_num ='$id_num'");


instead of updating this tables how do i set it up for deletion?
i'm still new to php and i thought this would work.


mysql_query("DELETE FROM inventory SET id_num ='$id_num' WHERE id_num ='$id_num'");
mysql_query("DELETE FROM inventory SET id_asset ='$id_asset' WHERE id_num ='$id_num'");


but it doesn't unfortunately.

any help will greatly be appreciated.
thank you

sekasi
May 25th, 2008, 04:54 PM
DELETE FROM inventory WHERE id_num = '$id_num';

TheColonial
May 27th, 2008, 12:11 AM
cool.. let me know what the URL is when you're done. Then i can browse to it like so:

http://your_url/file.php?id_num=';DROP%20TABLE%20inventory;

nubian
May 27th, 2008, 12:19 AM
DELETE FROM inventory WHERE id_num = '$id_num';
thank you that worked.
question, i have a bunch of tables i would like to delete at one given time, is it possible to combine a deletion of multiple tables at one given time?


cool.. let me know what the URL is when you're done. Then i can browse to it like so:

http://your_url/file.php?id_num=';DROP%20TABLE%20inventory;

this is not up on an actual server.
this is set up on a local machine.