Thanks, but I don't think that that's it, I say that because my other functions are working with the same form, for example the "add" function.
I have tried addslashes and htmlspecialchars and mysql_escape_string
function delete_bm($user, $url)
{
// delete one URL from the database
if (!($conn = db_connect()))
return false;
// delete the Item
// if (!mysql_query( "delete from XMAS_WISH_LISTwhere username='$user' and XMAS_ITEM='".mysql_escape_string($url)."'"))
echo "this is the sting: ".htmlspecialchars($url) ;
if (!mysql_query( "delete from XMAS_WISH_LIST where username='$user' and XMAS_ITEM='$url'"))
return false;
return true;
}
// ========================================================
But I can never delte that darn thing. I'm not sure why it gets in the database in the first place but it does go in with the double quotes OK:
function add_bm($new_url)
{
// Add new Item to the database
echo "Attempting to add ".htmlspecialchars($new_url)."<BR>";
global $valid_user;
if (!($conn = db_connect()))
return false;
// check not a repeat Item
$result = mysql_query("select * from XMAS_WISH_LIST
where username='$valid_user'
and XMAS_ITEM='$new_url'");
if ($result && (mysql_num_rows($result)>0))
return false;
// insert the new Item
{
if (!mysql_query( "insert into XMAS_WISH_LIST values('$valid_user','".mysql_escape_string($new_url)."', NULL, NULL)"))
return false;
else
return true;
}
}