Any idea what I did wrong?
'WHERE id =' at line 16
I am not sure why it says line 16 but I think it is talking a bout line 64.
<?php
include 'resources/init.php';
if (isset ($_GET['id'])) {
$q = "SELECT * FROM Client WHERE id = {$_GET['id']}";
$result = mysql_query($q);
$client = mysql_fetch_array($result);
}
?>
<a href="index.php">Back To List</a>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
First Name: <input type="text" name="firstname" value="<?php echo $client['firstname']; ?>" />
Last Name: <input type="text" name="lastname" value="<?php echo $client['lastname']; ?>" />
<br>
<br>
Email: <input type="text" name="email" value="<?php echo $client['email']; ?>" />
<br>
<br>
Invoice #:<input type="text" name="invoice" maxlength="5" size="5" value="<?php echo $client['invoice']; ?>" />
<br>
<br>
<br>
<br>
Windows Key:<input type="text" name="wink" maxlength="24" size="24" value="<?php echo $client['wink']; ?>" />
Windows Type:<input type="text" name="wint" maxlength="24" size="24" value="<?php echo $client['wint']; ?>" />
<br>
<br>
<br>
<br>
VIPRE Type:<input type="text" name="vtype" maxlength="3" size="3" value="<?php echo $client['vtype']; ?>" />
User Count:<input type="text" name="usera" maxlength="3" size="3" value="<?php echo $client['usera']; ?>" />
Year Count:<input type="text" name="yeara" maxlength="3" size="3" value="<?php echo $client['yeara']; ?>" />
<br>
<br>
Start Date:<input type="text" name="sdate" maxlength="10" size="10" value="<?php echo $client['sdate']; ?>" />
Expire Date:<input type="text" name="edate" maxlength="10" size="10" value="<?php echo $client['edate']; ?>" />
<br>
<br>
VIPRE Key: <input type="text" name="viprek" maxlength="24" size="24" value="<?php echo $client['viprek']; ?>" />
<br>
<br>
<br>
<input type="submit" name="submit" Value="Modify" />
</form>
<?php
if(isset($_POST["submit"])) {
$u = "UPDATE Client SET
`firstname`='$_POST[firstname]',
`lastname`='$_POST[lastname]',
`email`='$_POST[email]',
`invoice`='$_POST[invoice]',
`wink`='$_POST[wink]',
`wint`='$_POST[wint]',
`vtype`='$_POST[vtype]',
`usera`='$_POST[usera]',
`yeara`='$_POST[yeara]',
`sdate`='$_POST[sdate]',
`edate`='$_POST[edate]',
`viprek`='$_POST[viprek]',
WHERE id = {$_POST['id']}";
mysql_query($u) or die (mysql_error());
echo "User has been modified!";
header("Location: index.php");
}
?>