Jump to content

Delet row that contains ....


Worqy

Recommended Posts

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.

Link to comment
Share on other sites

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'";

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.