Jump to content

Fail to input dataColumn count doesn't match value count at row 1


Recommended Posts

if(isset($_POST['Edit']))
{
echo "Success";
$u_cl = mysql_real_escape_string($_POST['clt']);
$u_c = mysql_real_escape_string($_POST['ct']);
$u_cb = mysql_real_escape_string($_POST['cbt']);
$u_cc = mysql_real_escape_string($_POST['cct']);

if(!$u_cl OR !$u_c OR !$u_cb OR !$u_cc)
{
echo '<script type="text/javascript">alert("Please fill up the form")</script>';
require "custodian_edit.php";
}
else
{
$query1 = "UPDATE $tbl_name SET Cafe_Latte='$u_cl', Chocolate='$u_c', Creme_Brulee='$u_cb', Cookies_Cream='$u_cc' WHERE inven_id = 1";

mysql_query($query1) or die('error'.mysql_error().'in query'.$SQL);
echo "Record Update";
}
}

 

anyone knows what I did wrong? I am trying to update the 1st row and it is not working...

and while you define not working, you may also want to define $tbl_name....

 

:tease-01:

I was going to ask that, but if it were undefined it should trigger the error, printing out the SQL, making it obvious.

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.