On Tuesday 15 April 2008 05:39:24 Tedit kap wrote:
>
> $query="INSERT INTO table1 (iid, title1, par1, par2, par3) VALUES
> ($vrb1,$vrb2,$vrb3,$vrb4,$vrb5)";
> mysql_query($query) or die (' I could not update the database');
>
Hi.
The whole depends on what kind of date are you inserting in the database, but
I assume title is a string. Strings, and basically every other kind of data
except integers, have to be in single or double quotes when you give it in
the sql syntax. So basicly the line should look like this:
query="INSERT INTO table1 (iid, title1, par1, par2, par3) VALUES
($vrb1,'$vrb2','$vrb3','$vrb4','$vrb5')";
Or by escaping the double quotes:
query="INSERT INTO table1 (iid, title1, par1, par2, par3) VALUES ($vrb1,
\"$vrb2\",\"$vrb3\",\"$vrb4\",\"$vrb5\")";
regards
mmlado
P.S. When you have these kind of errors, it's got to write out the sql syntax
you want to give to the database, and copy/paste it some database handling
program, and "play" there with it until it works. And you'll get an exact
position of the error in it, too.