Delete not working

admin

Administrator
Staff member
For some reason my DELETE FROM statement isn't wanting to delete the correct (or any for that matter) rows. I'm basically passing a username to it under $fDelName and then I use this to delete the row that the username belongs to:

$sql = "DELETE FROM newsusrs WHERE username = $fDelName";

$result = mysql_query($sql) or die ("Could not delete ".mysql_error());

Unfortunately it gives me this error:

Could not delete Unknown column 'me' in 'where clause'

"me" is what the value of $fDelName was passed as so it seems to be trying to look for the value of $fDelName as the column value instead of using username. Whats going wrong?

Thanks,
stf
 
Back
Top