sent.php
CODE
<?php
// connect here
$left = $_POST['leftside'];
$result = mysql_query('UPDATE about SET left = "$left" WHERE id = 1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
//echo 'Your request has been sent';
?>
Member.PHP
CODE
<?php
session_start();
if($_SESSION['username'])
{
echo "Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Logout</a><br>";
$directions = "<h3>Directions:</h3>To edit text, simply click in one of the boxes you wish to change.<br> Click save to save your change. <br> Once you press save, the update will be sent automatically to the Live Site!<br>";
// connect here
$query = mysql_query("SELECT * FROM about");
$query_row=mysql_fetch_array($query);
echo $directions;
}
else
die("You must be logged in!");
?>
<html>
<head>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br />
<div class="column one">
<form method="post" action="sent.php">
<table >
<tr>
<td >
<label for="leftside"><h4>Home-Left-Side:</h4></label>
</td>
<td valign="top" >
<textarea name="leftside" maxlength="1000" cols="30" rows="20" value="lol"><?php echo($query_row[left]); ?></textarea>
<br />
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</table>
</div>
<div class="column two">
<form name="contactform" method="post" action="feedback.php">
<table >
<tr>
<td >
<label for="comments"><h4>Home-Right-Side:</h4></label>
</td>
<td valign="top" >
<textarea name="comments" maxlength="1000" cols="30" rows="21" value="lol"><?php echo($query_row[right]); ?></textarea>
<br />
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</table>
</form>
</div>
</body>
</html>
I keep getting this error on the "Sent.php" page..
Invalid query: 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 'left = "$left" WHERE id = 1' at line 1
Please help
