Jump to content

[SOLVED] Ezy question DROP TABLE help please


ccrevcypsys

Recommended Posts

I am trying to make it to where when someone clicks [delete] it will delete the data out of the database but i cant seem to get it to work. I know its a n00b question but it should be ez to figure out.

 

<?php
$deletetable = $db->select("DROP ".$glob['dbprefix']."CubeCart_inventory where productId=");

$artist_console->assign("VAL_DELETE_LINK",$deletetable);

?>

Link to comment
Share on other sites

I could be confused about what you are doing here, but if you are just deleting a row, the correct command is DELETE.  DROP is for tables.  In fact, it is best if you mySQL user would not even have DROP priv. on the database at all. 

 

In fact, DELETE is dangerious, too, but you should get this working so you know what to do. 

 

DELETE FROM table WHERE condition

 

Once you get comfortable with that, make a field in a table called deleteme or whatever.  When somebody deletes something, mark it as 1.  If you don't have permission to DELETE anything, then if your site gets hacked somehow, at least no rows will be deleted.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.