Newbie question : delete via php fails
Posted: Sat Mar 10, 2007 9:17 pm
I have a small piece of code that is failing and have no idea why ..
function delete($User){
$query = "delete from test where name='{$User}'";
echo "<BR>$query<BR>";
mysql_query($query) or die ('Query failed');
}
I get query failed every time I run it. The same script has functions for querying and adding data and they work fine. the user has delete privileges on the table.
I am a UNIX administrator trying to put together a website for system and password management. Is there anything already out there that I can use quickly? I am quite comfortable with shell scripting, but php is a little out of my domain. I don't want to re-invent the wheel here ....
Thanks,
Red
function delete($User){
$query = "delete from test where name='{$User}'";
echo "<BR>$query<BR>";
mysql_query($query) or die ('Query failed');
}
I get query failed every time I run it. The same script has functions for querying and adding data and they work fine. the user has delete privileges on the table.
I am a UNIX administrator trying to put together a website for system and password management. Is there anything already out there that I can use quickly? I am quite comfortable with shell scripting, but php is a little out of my domain. I don't want to re-invent the wheel here ....
Thanks,
Red