Adding a function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hewstone
Forum Newbie
Posts: 14
Joined: Fri Nov 14, 2008 10:57 am

Adding a function

Post by hewstone »

I have some code below which outputs a HTML table. The values in each cell come from a database. I want to add a function to the view and delete cell (marked in red) so when everytime a user clicks on it, it will do a SQL command i.e. Delete * From tblname...... How can i do this??

$temp = 1;
while(!$rs->EOF){
$date = $rs->Fields("date1")->value;
$time = $rs->Fields("Time1")->value;
$Dis = $rs->Fields("table_name")->value;


if ($temp1 == 1){
echo "<tr>";
echo "<td><font size='-1'><b>Date</b>";
echo "</td>";
echo "<td><font size='-1'><b>Time</b>";
echo "</td>";
echo "<td><font size='-1'><b>TableName</b>";
echo "</td>";
echo "</tr>";
}
echo "<tr>";
echo "<td><font size='-1'>".$date;
echo "</td>";
echo "<td><font size='-1'>".$time;
echo "</td>";
echo "<td><font size='-1'>".$Dis;
echo "</td>";
echo "<td><font size='-1'>View";
echo "</td>";
echo "<td><font size='-1'>Delete";
echo "</td>";
echo "</tr>";

$temp = $temp + 1;

$rs->MoveNext();
Post Reply