I'm building a database search for a project at our county courthouse. A user will have the option to create a profile, update it, and be able to search the database for other employee profile information. I'm concerned with updating the profile. I've made a page, called update.php, which upon logging in, will populate the fields with information that the employee had entered in their profile. In order to post the update, another PHP file, which I'm calling postupdate.php, should be called. Everything has worked fine up to this point, and I am getting errors which will not allow me to update. Here is my code:
<?php
foreach($HTTP_POST_VARS as $varname => $value)
$formVars[$varname]=$value;
$db1=mysql_connect("$localhost","$Name","$SQL_pass")
mysql_select_db("courthouse");
echo "Record Updated<br><a href=\"update.htm\">Click Here</a> to update another record.<br>";
$query="UPDATE employee_info set ".
"f_name= \"".$formVars["f_name"]."\",".
"l_name= \"".$formVars["l_name"]."\",".
"dept= \"".$formVars["dept"]."\",".
"phone= \"".$formVars["phone"]."\",".
"email= \"".$formVars["email"]."\",".
"pass= \"".$formVars["pass"].
"\" WHERE user_name = \"".$formVars["user_name"]."\"";
mysql_query($query);
mysql_close($dbl);
?>
I've been using this code off of the thread on http://netadmintools.com/art332.html
It's a good tutorial, but I am having trouble making my code function the same as it does in this tutorial. If someone can please check into what's going on here, and why I am not able to update any records, please let me know. I need an expert's opinion! TIA, Mike
lukatchm@misericordia.edu