Can anyone tell me what is wrong with this script???
I've been trying for hours, but just can't seem to get it to work.
<form action="title.php" method="post">
<?
require('../config.inc');
// connect to database
$cid = mysql_connect($host,$usr,$passwd);
$select_db = mysql_select_db($db);
// processed when form is submitted back onto itself
if ($REQUEST_METHOD=="POST") {
// setup SQL statement
$SQL = " UPDATE title SET";
$SQL = $SQL . " page_name = '$page_name', ";
$SQL = $SQL . " background_url = '$background_url', ";
$SQL = $SQL . " WHERE id = '$id' ";
// execute SQL statement
$result = mysql_db_query($db,"$SQL",$cid);
// check for errors
$uconfirm = "Information Updated!";
} else {
require('../config.inc');
// connect to database
$cid = mysql_connect($host,$usr,$passwd);
$select_db = mysql_select_db($db);
$sql = "select * from title";
$result = mysql_query($sql);
while ($directory = mysql_fetch_array($result)) {
$page_name=$directory['page_name'];
$background_url=$directory['background_url'];
}
?>
This is the error I get when processing:
Parse error: parse error, unexpected $ in /home/dhill/simplebit-www/dillenger/bio/title.php on line 113