DELETE FROM does not work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
systemous
Forum Newbie
Posts: 2
Joined: Sun Dec 26, 2010 11:41 am

DELETE FROM does not work

Post by systemous »

I am trying to find out why the DELETE FROM is not working in the mysql server but i can't find it. Here is my code:

Code: Select all

<?php
	$dbcon = mysql_connect("localhost", "root", "");
	
	mysql_select_db("mydb", $dbcon);
	
	mysql_query("DELETE FROM folders WHERE deletec LIKE 'hello');
	
	mysql_close($dbcon)
?>
Any ideas? :S
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: DELETE FROM does not work

Post by Celauran »

The query looks fine assuming you have a column called 'deletec' and 'hello' as a value in that column.
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: DELETE FROM does not work

Post by internet-solution »

try

Code: Select all

mysql_query("DELETE FROM folders WHERE deletec LIKE '%hello%');
Post Reply