Worqy Posted September 25, 2011 Share Posted September 25, 2011 Hi. I need help with a PHP script that deletes mysql data. Is there some way to delete a sql row by only telling the data stored in it. Let say I have a table called "Users", with columns "Username" and "Password". Can I somehow delete is like this "DELETE FROM Users WHERE IT CONTAINS 'Kevin', 'Secret'" now it would search and see if there is any like with that data on it. I need it because I have a table with unknown column names, I only know the data stored. Quote Link to comment https://forums.phpfreaks.com/topic/247825-delet-row-that-contains/ Share on other sites More sharing options...
trq Posted September 25, 2011 Share Posted September 25, 2011 I have a table with unknown column names That makes no sense. Quote Link to comment https://forums.phpfreaks.com/topic/247825-delet-row-that-contains/#findComment-1272567 Share on other sites More sharing options...
AyKay47 Posted September 25, 2011 Share Posted September 25, 2011 i agree, that last statement makes no sense at all, nor does your entire statement really.. however if you want to choose what data to delete you will want to use the WHERE clause.. $sql = "DELETE FROM table WHERE username = 'username' AND password = 'password'"; Quote Link to comment https://forums.phpfreaks.com/topic/247825-delet-row-that-contains/#findComment-1272590 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.