Hi there,
I am trying to insert a lot of fields into a MySQL database, some are failing, so I am adding some code into my PHP script to try and track down what is occurring.
The replace seems to work as I can see the fields being populated in mysql, but I get this error:
1064: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 '1' at line 1
//insert query
if (strlen($link_name)>0)
{
$query = mysql_query("REPLACE into jos_mt_links
(link_id, link_name, alias, link_desc, user_id, link_approved, metadesc, link_created, link_modified, website, price)
VALUES ('$link_id','$link_name','$link_name','$description','63','1','$metadesc','$link_created','$link_modified','$website','$cost')");
echo $link_name . "has been inserted <br />";
print "SQL-Query: ".$query."<br>";
if(mysql_query($query,$db))
{
echo "<center><font face='$fonts' size=2 color='$green'>";
echo " OK !</font><br><br>\n";
}
else
{
echo "<center><font face='$fonts' size=3 color='$red'>";
echo "Error<br><br>";
echo mysql_errno() . ":" . mysql_error() . "</font><br>\n";
}