Jump to content

Recommended Posts

Okay, so you are trying to insert a different amount of columns than you specified in the query. Since you didn't specify any columns in your query, it wants to insert data to all the columns.

 

So you need to modify your query and include the column names for the data you want to insert.

INSERT INTO `Companies` (company_name, basicpackage_description, location, postcode, upload) VALUES ('$company_name', '$basicpackage_description', '$location', '$postcode', '$upload')

 

Something like that, only with the actual column names.

Look at yours, now look at mine. Now yours, now mine. There's a difference. The INSERT statement can be broken down like this

INSERT INTO <TABLE> (<COLUMNS>) VALUES (<COLUMN VALUES>)

 

You can omit the <COLUMNS> but this means it will want to insert into every column. If you don't specify data for every column, you will get an error. If you have 10 columns and you only want to insert into 3 of them, you'll need to explicitly specify those 3 columns.

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.