hello how can i delete from this select query SELECT mp3_url.id, mp3_url.list_id, mp3_url.url, mp3_url.mp3_name FROM mp3_url, list_mp3_name WHERE list_mp3_name.username = 'hotsmusic' AND list_mp3_name.list_name = 'muse' AND list_mp3_name.id = mp3_url.list_id LIMIT 0 , 1
can i delete the select query. like this delete mp3_url.id, mp3_url.list_id, mp3_url.url, mp3_url.mp3_name FROM mp3_url, list_mp3_name WHERE list_mp3_name.username = 'hotsmusic' AND list_mp3_name.list_name = 'muse' AND list_mp3_name.id = mp3_url.list_id LIMIT 0 , 1
To delete a value or values from table you have to write: DELETE FROM [COLOR="DarkRed"]the table name[/COLOR] WHERE list_mp3_name.username = 'hotsmusic' AND list_mp3_name.list_name = 'muse' AND list_mp3_name.id = mp3_url.list_id LIMIT 0 , 1; Code (markup): enter the table name from which you want to delete the value or values!!!
hi.... just try,,, DELETE FROM mp3_url WHERE list_id = ( SELECT list_mp3_name.id FROM list_mp3_name, mp3_url WHERE list_mp3_name.username = 'hotsmusic' AND list_mp3_name.list_name = 'muse' AND list_mp3_name.id = mp3_url.list_id) i hope that's what you need to... cheers,,,
Is there any relation in your mp3_url, list_mp3_name table?? these are two different table which data you want delete. if there any foreign key than set it as Cascading on Delete and delete the content from Master table by doing so the data from child table will automatically delete.