I want to delete data from table (PHP + Mysql), with three conditions. I tried both ‘AND’ and ‘,’ but don’t work.
mysql_query("DELETE FROM `posts-meta` WHERE `post_id` = '$postid' AND `meta_name` = 'post_tag' AND `meta_value` = '$tag'")
Is there any way?
If you’re looking for a query that’ll delete the results that match to all three of your conditions, you’re query is accurate:
If you’re looking to delete all results matching to either one of your conditions, you should go with OR:
Hope I don’t offend you by re-stating the obvious with this common knowledge, though your question is really missing context, I have no idea what exactly you’re trying to accomplish, why it doesn’t work, …