Hello,
Like all others I am also not able to add records to mysql database. My code is :
<?php
include("required.php");
echo "$id";
$query = "INSERT INTO '$tablename' ('id','product','comment') VALUES ('$id','$product','$comment')";
$connection = mysql_connect($ip, $user, $password);
if (!$connection)
{
die("Connection with MySQL could not be established");
return;
}
else {
echo "connected<br>";
$dconnection = mysql_select_db($dataname, $connection);
$queryres = mysql_query($query);
echo "right<br>";
if ($queryres)
echo "Record added<br><a href='add.htm'>Add More Records</a>";
else echo mysql_error();
mysql_close($connection);
}
?>
Fields in table are: id: varchar(8), product: varchar(50), comment: varchar(50)
I am trying to connect to mysql on remote sever through IP address. I acn connect as I am echoing some alerts after each operation. But not success and can not add records.. it's giving me error page... as
101SKconnected
right
You have an error in your SQL syntax near ''product-list' (id,product,comment) VALUES ('101SK','CP','good')' at line 1
Where am I wrong...😕