Update query in PHP doesn't work as expected

djmoney586

New Member
\[code\]<center><?phpif(isset($_POST['submit'])){ $title = $_POST['title']; $content = $_POST['content']; $id= $_POST['id']; mysql_query("UPDATE post SET title='$title',content='$content' WHERE p_id='$id'"); echo 'success';}else{?><form action='update.php' method='post'><span style="font-size:26px;"><strong><span style="font-family: verdana, geneva, sans-serif; ">Title:&nbsp;</span></strong></span><input type='text' name='title' /><br /><input type="hidden" value="http://stackoverflow.com/questions/12804435/<?php echo $_REQUEST['id']?>" name="id"><span style="font-size:26px;"><strong><span style="font-family: verdana, geneva, sans-serif; ">Content:&nbsp;</span></strong></span><textarea name='content' ></textarea><br /><input type='submit' name='submit' value='http://stackoverflow.com/questions/12804435/EDIT'/></form><?php}?></center>\[/code\]What is the problem with this query? $_REQUEST['id'] is from the other page of my php wich is from hyperlink with value.By the way I am a beginner with php.
 
Back
Top