scarface83 Posted March 28, 2007 Share Posted March 28, 2007 Hi, how would i do the following ? $query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); im just getting "Unknown table 'notes' in MULTI DELETE" ? thanks Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/ Share on other sites More sharing options...
joshi_v Posted March 28, 2007 Share Posted March 28, 2007 Hi, I think your delete query is wrong. It should be like this... $query = mysql_query("DELETE FROM absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); Regards, Joshi. Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216644 Share on other sites More sharing options...
scarface83 Posted March 28, 2007 Author Share Posted March 28, 2007 how would i get it to remove the data from all the colums (notes, datestamp, abs_value, ID ) or would that query delete the whole row ? thankyou Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216646 Share on other sites More sharing options...
DeathStar Posted March 28, 2007 Share Posted March 28, 2007 Truncate it! $query = mysql_query("TRUNCATE TABLE absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216647 Share on other sites More sharing options...
scarface83 Posted March 28, 2007 Author Share Posted March 28, 2007 sorry to go one but just confirm this would only delete all the data in that row on the table , as i have a lot of duplicated info and i dont want it to delete all of them ? thanks Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216649 Share on other sites More sharing options...
DeathStar Posted March 28, 2007 Share Posted March 28, 2007 It wil ljust clear the table, not delete. Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216651 Share on other sites More sharing options...
scarface83 Posted March 28, 2007 Author Share Posted March 28, 2007 i just need it to delete one row not the whole table Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216652 Share on other sites More sharing options...
joshi_v Posted March 28, 2007 Share Posted March 28, 2007 Hmm! Then use delete query . $query = mysql_query("DELETE FROM absence_mgt WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error()); It will remove only a single row where id is matching to the value u passed in query where condition. WHERE datestamp='$date' AND ID='$vtc_login' So need to worry. it will remove onyl one row. Regards, Joshi. Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216653 Share on other sites More sharing options...
DeathStar Posted March 28, 2007 Share Posted March 28, 2007 Might ant to read this to: http://www.databasejournal.com/features/mysql/article.php/2201621 Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216654 Share on other sites More sharing options...
scarface83 Posted March 28, 2007 Author Share Posted March 28, 2007 Thanks for clearing that up Joshi it worked a treat , also thanks for you help deathstar Quote Link to comment https://forums.phpfreaks.com/topic/44612-solved-mysql-delete-help/#findComment-216655 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.