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
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());

Link to comment
Share on other sites

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

Edited by SocialCloud
Link to comment
Share on other sites

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.

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.