yeah I figured as much but I haven't quite got it yet. I changed it to the below and got this error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' on line
24. I don't see it? Can someone give me some guidance? PHP Code:
<?php
mysql_connect(localhost,root,"");
mysql_select_db(test) or die( "Unable to select database");
if(!empty($_POST["submit"]))
{
$apt = $_POST['apt'];
$query="SELECT * FROM testtable Where apt='$apt'";
$result=mysql_query($query);
if(mysql_num_rows($result))
{
echo "<form action='#' method='post'><b>Maintenance Update Test :<br /><br />
<table border='1'>
<tr>
<th>apt</th>
<th>name</th>
<th>date received</th>
<th>symptom</th>
<th>action</th>
<th>date completed</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>
<td align="center">".$id[]=$row['id'] $row['id']; ?></td>
<td><input type='text' name='apt' value='" . $row['apt'] . "'></td>
<td><input type='text' name='name' value='" . $row['name'] . "'></td>
<td><input type='text' name='datereceived' value='" . $row['datereceived'] . "'></td>
<td><input type='text' name='symptom' value='" . $row['symptom'] . "'></td>
<td><input type='text' name='action' value='" . $row['action'] . "'></td>
<td><input type='text' name='datecomplete' value='" . $row['datecomplete'] . "'></td>
</tr>";
}
echo "</table>
<input type='submit' name='update' value='Update Record' />
echo</form>";
}
else{echo "No listing for appartment $apt.<br />
Please select another.<br />";}
}
if(!empty($_POST["update"]))
{
for($i=0;$i<$count;$i++){
$sql1="UPDATE testtable SET apt='$apt[$i]', name='$name[$i]', 'datereceived='$'datereceived[$i]', 'symptom='$'symptom[$i]', 'action='$'action[$i]', 'datecomplete='$'datecomplete[$i]' WHERE id='$id[$i]'";
$result1=mysql_query($sql1) or die("Update query failed.");
echo "Record for appartment ".$_POST["apt"]." has been updated";
}
?>
<form method="post" action="#"><br />
<input type="text" name="apt"/> <p>
<input type="submit" name="submit" value="select apartment"/>
</form>