When the administrator goes to EDIT a record, I want to use the same table, because they may want to ADD a user (so I would need to keep the addition fields (goes up to 14), but enter the firstname and lastnames of those in firstname1, lastname1.... as they are entered in the database fieldnames of the same.
I started, but am stuck, as I need to do something like:
Code: Select all
SELECT * FROM diary WHERE bookingid = '$bookingid' AND firstname&count <> NULL...Otherwise, I will have to perhaps produce 14 of these $result2 queries!!
Here's the code as it stands now.
Code: Select all
echo "<tr><td><input type='text' name='firstname$counter'";
$result2 = mysql_query ("SELECT * FROM diary WHERE bookingid = '$bookingid'")or die(mysql_error());
while ($row2 = mysql_fetch_object($result2))
{
if ($row->firstname1
} mysql_free_result($result2);
echo "></td><td><input type='text' name='lastname$counter'></td></tr>";