I can't seem to get this code to update the mySQL database... I've searched and searched for the problem, and have even had someone else look at it. Maybe you can help me??
<?
session_start();
$id = $_GET["id"];
$server = "localhost";
$user = "user";
$pass = "pass";
$database = "staff";
$connection = mysql_connect($server, $user, $pass);
mysql_select_db($database, $connection);
if (isset($Submit))
{
$id = $_POST["id"];
$sql = "update employees
set first = '$first',
last = '$last',
department = '$department',
title = '$title',
WHERE id = $id";
$result = mysql_query($sql, $connection);
}
$sql = "SELECT * FROM employees WHERE id = '$id'";
$result = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($result)) {
echo ("<form name=\"form1\" method=\"post\" action=\"index.php?id=");
echo ("$id");
echo ("\">");
echo ("<p><img src=\"");
echo ("photos/");
echo ("$row[photo]");
echo (".jpg\" ");
echo ("width=\"100\" height=\"150\" align=\"left\"><b>");
echo ("First: <input type=\"text\" value=\"");
echo ("$row[first]");
echo ("\" name=\"first\">");
echo ("<br>");
echo ("Last: <input type=\"text\" value=\"");
echo ("$row[last]");
echo ("\" name=\"last\">");
echo ("<br>");
echo ("Department: <input type=\"text\" value=\"");
echo ("$row[department]");
echo ("\" name=\"department\">");
echo ("<br>");
echo ("Title: <input type=\"text\" value=\"");
echo ("$row[position]");
echo ("\" name=\"title\">");
echo ("<br>");
echo ("<br><br><input type=\"submit\" name=\"Submit\" value=\"Submit\"></form>");
}
?>