Jump to content

Column count error


Lassie

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.