ccrevcypsys Posted August 17, 2007 Share Posted August 17, 2007 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65485-solved-ezy-question-drop-table-help-please/ Share on other sites More sharing options...
phpknight Posted August 18, 2007 Share Posted August 18, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/65485-solved-ezy-question-drop-table-help-please/#findComment-327256 Share on other sites More sharing options...
d.shankar Posted August 18, 2007 Share Posted August 18, 2007 If you are facing difficulties in dropping table , first try to truncate the table using TRUNCATE TABLE command and then use the DROP command. Quote Link to comment https://forums.phpfreaks.com/topic/65485-solved-ezy-question-drop-table-help-please/#findComment-327466 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.