Warning: [fnn_insert] Column count doesn't match value count at row

Hi all.
whats the problem and how to fix?

hereunder the code.

thanks in advance

Warning: [fnn_insert] Column count doesn’t match value count at row 1 in

function fn_insert($user,$fdata)
{
$fname = mysql_escape_string($fdata[‘name’]);
$furl_1 = mysql_escape_string($fdata[‘1’]);
$furl_2 = mysql_escape_string($fdata[‘2’]);
$fcheck = mysql_escape_string($fdata[‘check’]);
$fstate = mysql_escape_string($fdata[‘state’]);
$fcity = mysql_escape_string($fdata[‘city’]);
$tsnow = time();

    $query = "INSERT INTO `tablex` VALUES (NULL,'$fname','$furl_1','$furl_2','$fcheck','$fstate','$fcity','$tsnow','$user',0,'n/a');";    
    @mysql_query($query) or die(trigger_error("[".__FUNCTION__."] ".mysql_error(), E_USER_WARNING));

    $fid = @mysql_insert_id() or die(trigger_error("[".__FUNCTION__."] ".mysql_error(), E_USER_WARNING));
    return $fid;

};

Hi there,

You may need to change your query to the following:

INSERT INTO `tablex` (`field1`,`field2`,`field3`,`field4`,`field5`,`field6`,`field7`,`field8`,`field9`,`field10`,`field11`) VALUES (NULL,'$fname','$furl_1','$furl_2','$fcheck','$fstate','$fcity','$tsnow','$user',0,'n/a')

You need to specify the fields that are having data inserted, and the values array must contain a value for every field specified.

Sponsor our Newsletter | Privacy Policy | Terms of Service