dvidunis Posted September 11, 2010 Share Posted September 11, 2010 hi, i wanted to make mail like but with mysql database, all is working i have single delete php that works, but i want multiple delete with checkboxes please help,notice: im newbie in php and 11 years old so please help :'(: <?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; ?> Quote Link to comment https://forums.phpfreaks.com/topic/213138-please-help/ Share on other sites More sharing options...
trq Posted September 11, 2010 Share Posted September 11, 2010 What exactly is the problem? Quote Link to comment https://forums.phpfreaks.com/topic/213138-please-help/#findComment-1109910 Share on other sites More sharing options...
dvidunis Posted September 11, 2010 Author Share Posted September 11, 2010 What exactly is the problem? i want to make an multi delete with checkboxes and i dont know how Quote Link to comment https://forums.phpfreaks.com/topic/213138-please-help/#findComment-1109912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.