Hi all
Im having problems with post data & fetch_array.
I have added a count($results) line to see how many rows are being shown.
My problem is that although I can see all the rows, the counter is only showing 1.
This is the code I have. I has spent a long time reading manuals & posts etc but can' find the solution. I know it is probably simple but so am I.
Any suggestions??
<?php
mysql_connect("#####", "#####", "#####") or die(mysql_error());
mysql_select_db("########") or die(mysql_error());
$result = mysql_query("SELECT * FROM staff WHERE status LIKE 'live' ORDER BY lname ") or die(mysql_error());
echo "<form method='post' action='upexceptions.php'>";
echo "<table
border='1'><tr><th>Colleague</th><th>Total</th><th>OT1</th><th>OT1.5</th><th>OT2</th><th>BH1</th><th>BH1.5</th><th>BH2</th><th>ABS</th><th>CSP</th><th></th><
/tr>";
while($row = mysql_fetch_array( $result )) {
echo "<tr><td>";
echo $row['fname'];
echo " ";
echo $row['lname'];
echo "<input type='hidden'";
echo " name='colleague'";
echo " value='";
echo $row['fname'];
echo " ";
echo $row['lname'];
echo " ";
echo $row['clock'];
echo "'></td>";
echo "<td><input type='text' name='hours' size=5 value='";
echo $row['hours'];
echo "'></td>";
echo "<td><input type='text' name='ot1' size='5' value='0'></td>";
echo "<td><input type='text' name='ot15' size='5'></td>";
echo "<td><input type='text' name='ot2' size='5'></td>";
echo "<td><input type='text' name='bh1' size='5'></td>";
echo "<td><input type='text' name='bh15' size='5'></td>";
echo "<td><input type='text' name='bh2' size='5'></td>";
echo "<td><input type='text' name='abs' size='5'></td>";
echo "<td><input type='text' name='csp' size='5'></td>";
echo "<td><input type='text' name='week' size='5'></td>";
}
echo "</tr></table>";
echo "No of records: ";
$qty = count($result);
echo $qty;
echo "<br><input type='submit' value='<<Update>>'></form>";
?>
If I can get the count to work then I should be able to resolve my next problem.
Thanks in advance.
Jolly_nolly