I am trying to fix my delete function that deletes a string of text that may or may not have single, double quotes, pound signs etc.
Code:
function delete_bm($user, $url)
{
// delete one text string from the database NOT a url as would be suggested
if (!($conn = db_connect()))
return false;
// delete the Item
if (!mysql_query( "delete from XMAS_WISH_LIST
where username='$user' and XMAS_ITEM='".mysql_escape_string($url)."'"))
return false;
return true;
}
When I run this on my web page, I don't get an error, it just does not delete the item that I am passing it, like the following: "test" (with quotes).
Any suggestions?
Mitch