Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-27-2011, 10:39 AM   #1
Registered: Nov 2004
Posts: 77

Rep: Reputation: 13
Warning: [fnn_insert] Column count doesn't match value count at row 1 in

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;
Old 09-27-2011, 12:27 PM   #2
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
The error obviously means that you've specified too few or too many values for the row being inserted. Maybe you should specify the column names explicitly before VALUES, which will incidentally help you verify that you're passing what you're supposed to be passing.
Kevin Barry
1 members found this post helpful.
Old 09-27-2011, 04:11 PM   #3
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13

It is fixed


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Row count Shell Script zaeem Linux - Newbie 4 10-08-2010 07:35 PM
Serial terminal emulation - bad row column count ? Vilius Linux - Software 3 06-15-2010 09:01 AM
DBD::mysql::st execute failed: Column count doesn't match value count at row 1 shifter Programming 2 02-24-2010 07:42 PM
SWATCH::not able to get the correct match count when i use regular expression vjayraghavan Linux - Newbie 0 03-27-2009 01:16 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration