Hi everyone, im having prblems with one line of code that refuses to work and throws up errors everytime i touch it, any ideas why its throwing up a parse error, unexpected T_CONSTANT_ENCAPSED_STRING. If it helps im I have a form that pulls up data from the database, i want to update the data and it get written back in to the database in to its id row.
PHP Code:
<?php if ($submit) { // process form $db = mysql_connect("localhost", "----", "------") or die("Could Not Connect To The Database. <br>" . mysql_error()); mysql_select_db("-----",$db) or die("Could Not Select The Proper Database. <br>" . mysql_error()); $name = $_POST['id']; $name = $_POST['name']; $emailadress = $_POST['emailaddress']; $approval = $_POST['approval']; >>>>> ERROR LINE<<<<< $sql*=*'UPDATE*klmreal*SET*name*= '$name',*emailaddress*= '$emailaddress',*approval*= '0'*WHERE*id*= '$_POST[id]''; $result = mysql_query($sql); if($result) { echo "Data Properly Inserted"; $url="formmail.php"; } else { echo "An Error occured while trying to process your information."; print ("<br>" . mysql_error()); } echo $sql ; echo "Thank you! Information entered.\n"; } else { // display form ?>
Any help would be great
Thanks
Lee
Last edited by 0beron; 06-04-2005 at 03:50 PM..
Reason: [php ] tags added
|