Should be $query = \"DELETE FROM login WHERE custID={$_POST['custid']} LIMIT 1\"; You don't need to specify columns when you're deleting rows from a table Also in this query Where are $custid, $user_name, $pass, $authtype, and $qns coming from? It also looks like you missed the '$'s on a few of the variables so the query should look like INSERT INTO banned_users(userid, user_name, user_password, user_type, question, ans, suspend_date) VALUES( '$custid', '$user_name', '$pass', '$authtype', '$qns', '$ans', '$suspend_date') You should really be using prepared statements though. Even if the data is coming from a "trusted source" they're much safer and prevent SQL-Injection attacks Thanks for the help on the first part; it makes sense. Now, "user_name," "pass," "authtype," "qns," and "ans" are login table fields. "custid" is a customer table field. Now, like I said. Since, I'm suspending the login, I'm not sure if I need the following: '$custid,' '$qns', and '$ans.' I just added them for security reasons in order to keep customers or tellers from going through a back door and entering their account if I suspend them. Maybe, I just need the "user_name," "pass," "authtype," and "suspend_date" fields along with the '$user_name', '$pass', '$authtype' and '$suspend_date' variables. Also need help with making sure that the info will delete from "login" and insert into "banned_users." Thanks. I even just tried the following for the version 6 code, but it didn't work either:
<?php
require '. ./db_connect.php'; //Connect mysql database
if (isset($_GET['custid']))
{
$query = "SELECT user_name FROM login\";
if ($r = mysql_query($query, $link))
{
if (isset($_POST['custid']))
{
$query = \"DELETE FROM login WHERE user_name\";
$r = mysql_query($query, $link);
$query = \"INSERT INTO banned_users (
user_name,
user_password,
user_type,
question,
ans,
suspend_date) VALUES (
'$user_name',
'$pass',
'$authtype',
'$qns',
'$ans',
'$suspend_date')\";
if (@mysql_query($query, $link))
{
echo \"Account Suspended Successfully\";
echo \"<p>Click <a href='admin_ban_cust_sel.php'>here</a> to suspend another\";
exit(0);
}
else
{
echo \"Could not suspend account\";
echo \"<p>Click <a href='admin_ban_cust_sel.php'>here</a> to try again\";
exit(0);
}
}
}
}
$db_close=mysql_close();
?>
Really, $custid is for echoing the info into the dropdown menu on the previous page.