Having some trouble getting this query to work correctly.
mysql_query("DELETE FROM `table` WHERE `id` = '$id' AND 'username' = '$username' ");
tried replacing variables with actual data and running it in phpmyadmin to no success
any thoughts?
Having some trouble getting this query to work correctly.
mysql_query("DELETE FROM `table` WHERE `id` = '$id' AND 'username' = '$username' ");
tried replacing variables with actual data and running it in phpmyadmin to no success
any thoughts?
You're quoting the username column with ' instead of `
use:
mysql_query("DELETE FROM `table` WHERE `id` = '$id' AND `username` = '$username'");
not:
mysql_query("DELETE FROM `table` WHERE `id` = '$id' AND 'username' = '$username'");
Please, for the love of the internet, don't built an SQL query yourself. Use PDO.