Jump to content

Recommended Posts

I have an input form with a number of variables.

When I try to insert the values I get an error 'Column count doesnt match value count at row 1'

I use the format INSERT INTO table (cols1,2,..) VALUES ('Value1',' Value2',)

The first column  in the table is the primary which is auto increment.

The intial table structure is

property_id

V_id

rci_ref

country

region etc

Only the cols I am inserting are referenced in the query.

Where am I going wrong. How do I debug this?

$query = "INSERT INTO property (v_id,rci_ref,country,region,resort_name,unit_desc,unit_num,floor_type,ownership,floating,
	occ_wk ,booked,available,price,offers,trustees,description)
	VALUES
	($v,'$rc','$ct','$rg','$rn','$tp','$un','$ft','$ow','$cl','$oc','$bk','$av','$p','$o','$t','$d')";

		$result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error());



Link to comment
https://forums.phpfreaks.com/topic/70178-column-count-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.