Jump to content

[SOLVED] Column count doesn't match value count at row 1


SirChick

Recommended Posts

I keep getting this error with my script, not sure why the field name is correctly spelt so I'm kinda confused on what its telling me that i got wrong.. this is my code:

 

$GetBusinessType = mysql_query("SELECT * FROM businesstypes
                    WHERE Businesstype='$Business' order by BusinessID Limit 0,1")
                                or die(mysql_error()); 

                  
// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetBusinessType))) {
    echo "Business not found!";
    echo mysql_error();
}
$businessname = $row['BusinessName'];

 

Error

Column count doesn't match value count at row 1
Link to comment
Share on other sites

Oh in that case it must be this ...

 

$BusinessID = 1;
$businesstype = Food Market;

$query = "INSERT INTO `businesses` (BusinessID, OwnerID, BusinessType)
				Values ('$BusinessID', '{$_SESSION['Current_User']}, '$businesstype')";
	mysql_query($query) or die(mysql_error());

 

Managed to get another error in the process lol :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Food Market')' at line 2

Link to comment
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.