Jump to content

Delete From Mysql Database Help


Mancent

Recommended Posts

I can not delete from where id = id.

 

becasue that would delete all of them, I want to delete from table where id and name and fid == the same how would i do that can i do this with the delete

 

DELETE FROM tablename WHERE id = ('$id') AND name =('$name') AND fid =('$fid')

Link to comment
https://forums.phpfreaks.com/topic/270518-delete-from-mysql-database-help/
Share on other sites

For some reason its not deleting the data, been tracing it all out and the post being send is all correct. is my syntax wrong

 

$Delete = mysql_query("DELETE FROM WiiS_Shared_Music WHERE UserId='$MyUserId' AND UserFId='$FbUserId' AND SongName='$SongName' AND SongUrl='$SongUrl'") or die(mysql_error());

Remove or die(mysql_error()); as well as the mysql_query() to leave only your query:

 

 $Delete = "DELETE FROM WiiS_Shared_Music WHERE UserId='$MyUserId' AND UserFId='$FbUserId' AND SongName='$SongName' AND SongUrl='$SongUrl'"

 

Under that add echo $Delete; to show what you're looking for in the query

yes for now, but the bad thing about this is its so unsecure if anyone knew the userid and the friend id and the song name song url they could delete any song from any user with out adding a join table that had a accesstoken, so it still needs more work, but the basic there.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.