# Warning: \[fnn\_insert\] Column count doesn't match value count at row

**URL:** <https://www.phphelp.com/t/warning-fnn-insert-column-count-doesnt-match-value-count-at-row/14590>\
**Category:** MySQL database\
**Created:** [September 27, 2011, 4:24pm UTC](https://www.phphelp.com/t/warning-fnn-insert-column-count-doesnt-match-value-count-at-row/14590 "2011-09-27T16:24:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bondoq](https://www.phphelp.com/letter_avatar_proxy/v4/letter/b/f0a364/32.png) [@bondoq](https://www.phphelp.com/u/bondoq)\
**Post date:** [September 27, 2011, 4:24pm UTC](https://www.phphelp.com/t/warning-fnn-insert-column-count-doesnt-match-value-count-at-row/14590/1 "2011-09-27T16:24:07Z")

</div>

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;

```

};

---

<div class="post-metadata">

**Author:** ![smokeys\_13](https://www.phphelp.com/user_avatar/www.phphelp.com/smokeys_13/32/212_2.png) [@smokeys\_13](https://www.phphelp.com/u/smokeys_13)\
**Post date:** [September 27, 2011, 6:12pm UTC](https://www.phphelp.com/t/warning-fnn-insert-column-count-doesnt-match-value-count-at-row/14590/2 "2011-09-27T18:12:25Z")

</div>

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.
