Update issues
Posted: Thu Feb 12, 2009 4:19 pm
I get this error: Unable to 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 'group = 'Personal', title = 'hello', notes = 'erigeorijg' where photoID=31' at line 1
when i submit a form to this:
I can't see anything wrong with my syntax and obviously its pulling the variables fine and the table name and column names are all accurate. There are mor columns in the table but that shouldn't matter right? PLEASE HELP
when i submit a form to this:
Code: Select all
<?php include("includes/header_nav.php"); ?>
<div class="contwrapper">
<?php include("includes/db_connect.php"); ?>
<?php
$vgroup = $_POST['igroup'];
$vphotoid = $_POST['iphotoid'];
$vtitle = $_POST['ititle'];
$vnotes = $_POST['inotes'];
$query = "update photo set group = '$vgroup', title = '$vtitle', notes = '$vnotes' where photoID=$vphotoid";
mysql_query($query) or die("Unable to query:".mysql_error());
echo "<div class='textheader'>Photo Saved<br/><a href='photo_upload.php'>Back</a></div>";
mysql_close($con);
?>
</div>
</div>
</body>
</html>