Hello! I'm new in PHP and I can't understand how to make chekboxes work. I want to create tables with different names and then when I choose some to delete them.I could really use some help in how to make the checkboxes work. Here is what I have done:
<html>
<body>
<br>
<?php
@ $db=mysql_pconnect("localhost");
if(!$db)
{
echo "<hr>";
echo "<font size=\"5\" color=\"#FF0000\">Error:Could not connect to server.Unable to authenticate user.</font>";
echo "<hr><p></p>";
exit;
}
echo "<font size=\"4\" color=\"#FF0000\">Successfully connected to server.</font>";
@ $mysql=mysql_select_db("bigbang") or die ("Could not open database");
echo "<br><font size=\"4\" color=\"#FF0000\">Successfully connected to database.</font><br><br>";
echo"<hr>";
echo '<a href="delete.php?<?php print ?>">Delete</a><br>';
$show_query = "show tables";
$result = mysql_query($show_query,$db);
$num_rows = mysql_num_rows($result);
echo" There are currently $num_rows customers ----->";
echo"<br>";
print "<table border=2>\n";
while ( $a_row = mysql_fetch_row( $result ) )
{
print "<tr>\n";
foreach ( $a_row as $field )
$check = '<input type="checkbox" name="check[]" value="1">';
print "\t<td>$check $field</td>\n";
print "</tr>\n";
}
print "</table>\n";
?>
</body>
</html>