So I have created a page called ‘edit.php’ that pulls a sql record from the previous page and inputs that various values in text boxes so that they can be edited. I need to create an update script, but not sure where to start. Here is the code for the edit.php page:
[code=php]<?php
session_start();
if (@$_SESSION[‘auth’] !=”yes”)
{
header(“Location: login_form.php”);
exit();
}
?>
<?php
$host=”localhost”;
$username=”usernamer”;
$password=”password”;
$db_name=”db_name”;
$tbl_name=”table”;
// Connect to server and select database.
mysql_connect(“$host”, “$username”, “$password”)or die(“cannot connect”);
mysql_select_db(“$db_name”)or die(“cannot select DB”);
$member_id = $_GET[‘id’];
$results = mysql_query(“select * from member where id = $member_id”);
$row = mysql_fetch_assoc($results);
?>
<html>
<head>
<link href=”style.css” type=”text/css” rel=”stylesheet”>
</head>
<body>
<div align=”center”>
<table width=”80%” cellpadding=”0″ cellspacing=”0″ border=”0″>
<tr>
<td>Guest 1 <input type=”text” value=”<? echo $row[‘guest_1’]; ?>” name=”guest_1″></td>
</tr>
</div>
</body>
</html>
Any help, pointers or suggestions would be greatly appreciated. Thanks guys.