Fw: [phplib] Error message From: wfries (wfries <email protected>)
Date: 07/26/00

I am far from an expert in this but you do not seem to be naming the colums
first then the values. My personal preferance is to use the set method
because it keeps the colum name and the variable together as a set and is
much easer to manage when adding or deleting pairs from the query plus you
can see the colum that the var will go into. Try this

$query = "INSERT INTO yourtable SET col1='$var1', col2='$var2',
cola='$vara', colb='$varb' ";

$result = MYSQL_QUERY($query);

I hope this helps

Bill

----- Original Message -----
From: Eduardo Mena <eduardo <email protected>>
To: <phplib <email protected>>
Sent: Wednesday, July 26, 2000 2:49 PM
Subject: [phplib] Error message

Hi

I get this error message "Insert unsuccesfull: Column count doesn't match
value count at row %ld"

when I do

mysql_connect("localhost", "username", "");

// first field is auto_increment

$query = "INSERT INTO table VALUES ('', '1','$var1', '$var2', '$var3',
'$var4', '$var5', '$var6', '$var7', '$var8', '$var9', '$var10', '$var11',
curdate(),'', '')";

$result = mysql_db_query("db1",$query);

if ($result) {

echo "<p>added</p>"; }

else

{

echo "<b> Insert unsuccesfull:</b>", mysql_error();

exit;

}

mysql_close();

What is the problem?

Thanks for help me

Eduardo

eduardo <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>