Hi,
i am having trouble getting sopmething simple working -a administration
function where u can add topic and i cant see why.when i do to add a topc it
shows me the message Error!. - 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 '' at line 1
the code i am running is this
<?php
if (isset($Submit) ) {
$dbcnx = @mysql_connect ("localhost" , "username", "password") ;
if (!$dbcnx) {
echo ("<p>Unable to connect to the SQL Server at this time.</p>");
exit();
}
if (!@mysql_select _db("Pdcs2ga_ga me")) {
echo ("<p>Unable to locate the Pdcs2ga_game Database at this
time.</p>");
exit();
}
$sql = "INSERT INTO `Topic` (`name') VALUES ('$topic')";
$result = @mysql_query ($sql);
if ($result) {
echo ("The topic has been added.");
} else {
echo ("Error!. - " . mysql_error());
}
}
?>
i am having trouble getting sopmething simple working -a administration
function where u can add topic and i cant see why.when i do to add a topc it
shows me the message Error!. - 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 '' at line 1
the code i am running is this
<?php
if (isset($Submit) ) {
$dbcnx = @mysql_connect ("localhost" , "username", "password") ;
if (!$dbcnx) {
echo ("<p>Unable to connect to the SQL Server at this time.</p>");
exit();
}
if (!@mysql_select _db("Pdcs2ga_ga me")) {
echo ("<p>Unable to locate the Pdcs2ga_game Database at this
time.</p>");
exit();
}
$sql = "INSERT INTO `Topic` (`name') VALUES ('$topic')";
$result = @mysql_query ($sql);
if ($result) {
echo ("The topic has been added.");
} else {
echo ("Error!. - " . mysql_error());
}
}
?>
Comment