im making mail like site using mysql, i have a working
mysql_fetch_assoc()
while that displays correctly. i made a single delete page it worked, but i want multiple delete with checkboxes please help. if you can please dont user javascript im bad im javascript:(. heres the code:
<?php
include ("template.php");
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("wmail") or die(mysql_error());
$to = $_SESSION['email'];
// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM email WHERE account='$to'")
or die(mysql_error());
$result_num_rows = mysql_num_rows($result);
?>
<form method="post" action="searchinbox.php">Search: <input type="text" name="scontents"> <input type="submit" name="submit" value="Search"></form>
<?php
echo "<table border='3'>";
echo "<tr> <th>*</th> <th>From</th> <th>Subject</th> <th>Actions</th> </tr>";
// keeps getting the next row until there are no more to get
$rowcount = '0';
$unrowcount = '0';
while($row = mysql_fetch_array( $result )) {
$bolt1 = "";
$bolt2 = "";
$numberzero = "0";
$rowunread = $row['read'];
if ($rowunread == $numberzero){
$bolt1 = "<b>";
$bolt2 = "</b>";
$unrowcount++;
}
// Print out the contents of each row into a table
echo "<tr><td>";
echo "<input type='checkbox' name='checked'><br />";
echo "</td><td>";
echo "".$bolt1."".$row['sender']."".$bolt2."";
echo "</td><td>";
echo "".$bolt1."".$row['subject']."".$bolt2."";
echo "</td><td>".$bolt1."<a href='http://5.4.206.216/wmail/message.php?id=".$row['id']."'>View</a> - <a href='http://5.4.206.216/wmail/delmail.php?id=".$row['id']."'>DELETE!</a></td></tr>".$bolt2."";
$rowcount++;
}
echo "</table>";
$readcount = $rowcount-$unrowcount;
echo "You Have ".$rowcount." Mails in total, ".$unrowcount." Unread, ".$readcount." Read.";
if ($result_num_rows = 0)
echo "<br><b>No mail!</b>";
$redirect = '<meta HTTP-EQUIV="REFRESH" content="0; url=http://5.4.206.216/Wmail/index.php">';
if (isset($_SESSION["email"]))
$redirect = '';
echo $redirect;
?>
Please Help!:'(:'(