Hi,
I need to code this with register globals off but as far as I can see this is correct?!??!?
It comes up with this 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
This is the code:
<?
session_start();
$hostname_db = "localhost";
$database_db = "imperial";
$username_db = "";
$password_db = "";
$db = mysql_pconnect($hostname_db, $username_db, $password_db) or die(mysql_error());
mysql_select_db($database_db, $db);
if ((!$_POST[vote]) || (!$_POST[mvote]) || (!$_POST[qvote]) || (!$_POST[amvote]) || (!$_POST[afvote])) {
header("Location: view.php?lnk=$id"
;
exit;
}
$sql_vote2="UPDATE place SET svotes$vote=svotes$vote+1, mvotes$mvote=mvotes$mvote+1, qvotes$qvote=qvotes$qvote+1, amvotes$amvote=amvotes$amvote+1, afvotes$afvote=afvotes$afvote+1 WHERE id=$id";
$res_vote2=mysql_query($sql_vote2) or die(mysql_error());
$url=$ref[0];
header("Location: view2.php?lnk=$id"
;
?>
Reality is built on a foundation of dreams.
I need to code this with register globals off but as far as I can see this is correct?!??!?
It comes up with this 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
This is the code:
<?
session_start();
$hostname_db = "localhost";
$database_db = "imperial";
$username_db = "";
$password_db = "";
$db = mysql_pconnect($hostname_db, $username_db, $password_db) or die(mysql_error());
mysql_select_db($database_db, $db);
if ((!$_POST[vote]) || (!$_POST[mvote]) || (!$_POST[qvote]) || (!$_POST[amvote]) || (!$_POST[afvote])) {
header("Location: view.php?lnk=$id"
exit;
}
$sql_vote2="UPDATE place SET svotes$vote=svotes$vote+1, mvotes$mvote=mvotes$mvote+1, qvotes$qvote=qvotes$qvote+1, amvotes$amvote=amvotes$amvote+1, afvotes$afvote=afvotes$afvote+1 WHERE id=$id";
$res_vote2=mysql_query($sql_vote2) or die(mysql_error());
$url=$ref[0];
header("Location: view2.php?lnk=$id"
?>
Reality is built on a foundation of dreams.