Im back! lol Im trying to make an added feature to my script Im making. The script adds "items" to different columns of different tables of a database, and then lets you display the table, and if you click one of the headers it sorts the list alphabetically from that column.
What I want to do is make it so you can also click each row of the table and it will make a pop up box that says "Are you Sure you Want to Delete this Row" and then a yes or no. Yes will delete that row and no will just close the pop up.
This probably requires javascript but how would I got about doing this? Heres the code of displaying part.
/* now grab the first row and start the table */
$row = mysql_fetch_assoc ($result);
echo "<TABLE width=80% cellspacing=1 cellpadding=5 bgcolor=#000000 border=0>\n";
echo "<TR>\n";
foreach ($row as $heading=>$column) {
/* check if the heading is in our allowed_order
* array. If it is, hyperlink it so that we can
* order by this column */
echo "<a href=index.php?displaytable=$displaytable&order_by=$heading><TD bgcolor=#343941 onmouseout=style.backgroundColor='#343941'; onmouseover=style.backgroundColor='#383E47'; style.cursor='hand'><b>";
if (in_array ($heading, $allowed_order)) {
echo "<font face=Verdana size=2 color=#CCCCCC>$heading</font>";
} else {
echo "<font face=Verdana size=2 color=#CCCCCC>$heading</font>";
}
echo "</b></TD></a>\n";
}
echo "</TR>\n";
/* reset the $result set back to the first row and
* display the data */
mysql_data_seek ($result, 0);
while ($row = mysql_fetch_assoc ($result)) {
echo "<TR bgcolor=#3E434D>\n";
foreach ($row as $column) {
echo "<TD><font face=Verdana size=1 color=#CCCCCC><strong>$column</strong></font></TD>\n";
}
echo "</TR>\n";
}
echo "</TABLE>\n";