Hi All
I am trying to output a table to a web page from a database, which I can do ok.
Each row relates to a person, and each column has info about that person i.e. postcode, number, address etc. I want additional columns which give me the option to delete (or not show rather) the record.
This is my code to display the table:
// Collects data from table
$data = mysql_query("SELECT * FROM table WHERE Display = 'YES'")
or die(mysql_error());
// puts the info into the $info array
$info = mysql_fetch_array( $data );
?>
</head>
<body>
<h1 class="style1">Client Directory</h1>
<p>
<span class="style2">
<?php
Print "<table border=0 cellspacing=20 cellpadding=0
<tr>
<td width=100>Client Name</td>
<td width=30>Postcode</td>
<td width=200>Type of Enquiry</td>
<td width=70></td>
<td width=100>Date of Enquiry</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>";
// Print out the contents of the entry
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<td> ".$info['Name'] . "</td>";
Print "<td> ".$info['Postcode1'] ." " .$info['Postcode2'] ."</td>";
Print "<td> ".$info['Home_Status'] . "</td>";
Print "<td> "."Remove" ."</td>";
Print "<td> ".$info['Date'] . "</td></tr>";
}
Print "</table>";
Print "All Done";
?>
So all records with field 'Display' set to 'YES' is shown.
Can you please help me with having the 'Remove' column setting the Display value for that record only to 'NO'.
I.e. I can choose to 'not show' individual records by clicking remove on each row at will, and a refresh occurs each time??
I think that makes sense?
Thanks!
Nick