当我点击“AD RECORD”按钮时出现以下错误:
INSERT failed: INSERT INTO user_master VALUES('cha' , 'rstein' , 'bar' , 'foo')
Column count doesn't match value count at row 1
来自以下代码:
if (isset($_POST['delete']) && isset($_POST['first']))
{
$first = get_post('first');
$query = "DELETE FROM user_master WHERE first='$first'";
if(!mysql_query($query, $db_server))
echo "DELETE failed: $query
" .
mysql_error() . "
";
}
if (isset($_POST['first']) && isset($_POST['last']) && isset($_POST['user_name']) && isset($_POST['email']))
{
$first = get_post('first');
$last = get_post('last');
$email = get_post('email');
$user_name = get_post('user_name');
$query = "INSERT INTO user_master VALUES" . "('$first' , '$last' , '$user_name' , '$email')";
if(!mysql_query($query, $db_server)) echo "INSERT failed: $query
" . mysql_error() . "
";
}
echo <<
First
Last
Username
END;