kdigital Posted January 6, 2013 Share Posted January 6, 2013 $sql = "SELECT * FROM messages WHERE to_user_id='$to_user_id' LIMIT $offset, $rowsperpage"; $result = mysql_query($sql) or trigger_error("SQL", E_USER_ERROR); if (empty($numrows)) { $totalpages = 1; $error = 'You don\'t have any messages'; } echo "<br />"; echo "$error" . "<br />"; echo "<br />"; echo '<form action="my_messages.php?from_user_id="$from_user_id"" method="POST">'; echo "<div style=\"float:left; margin-left:5px;\"><input type=\"submit\" name=\"delete\" id=\"button\" value=\"delete\"/></div>"; echo "<table width=980><tr> <td></td><td><b>From</b></td> <td width=120></td> <td width=120><b>Subject</b></td> <td width=120></td> <td width=120>Date Sent</td> <td width=120></td> <td width=120></td> <td width=120></td></tr>"; //Fetch data while($row = mysql_fetch_assoc($result)) { //$to_user_id = $_SESSION['id']; if (isset($_POST['delete'])) { $msg = $_POST['msg']; //$from_user_id = $_POST['from_user_id']; $from_user_id = $_GET['from_user_id']; $query = mysql_query("DELETE FROM messages WHERE from_user_id='$from_user_id'"); } echo "<tr> <td><input type=\"checkbox\" name=\"msg\" value=\"".$row["from_user_id"]."\"></td> <td>".$row['from_user']."</td> <td></td> <td>".$row['subject']."</td> <td width=300></td> <td>".$row['date_sent']."</td> <td></td> <td></td> <td></td> <td></td></tr>"; } echo "</form></table>"; Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/ Share on other sites More sharing options...
DavidAM Posted January 7, 2013 Share Posted January 7, 2013 No question No error message Just naked code hung out there for the world to see How pretty Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403782 Share on other sites More sharing options...
kdigital Posted January 7, 2013 Author Share Posted January 7, 2013 No question No error message Just naked code hung out there for the world to see How pretty Don't worry about it. Posting this as a job on Odesk. Not going to waste anymore time on coding forums waiting hours and hours for help. I'd rather pay a programmer to code with good notes than post on forums for help and wait for hours for a good response all while crossing my fingers. Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403807 Share on other sites More sharing options...
haku Posted January 7, 2013 Share Posted January 7, 2013 That is likely your best bet. The forums are here for people to learn and share information, so that we can all become better coders, but if you are just looking to get some code fixed, then paying someone to do it will pretty much always be the better way to go. Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403813 Share on other sites More sharing options...
kdigital Posted January 7, 2013 Author Share Posted January 7, 2013 That is likely your best bet. The forums are here for people to learn and share information, so that we can all become better coders, but if you are just looking to get some code fixed, then paying someone to do it will pretty much always be the better way to go. I've actually learned a lot by paying people to fix my code lol. It's the best way to learn to me. Figure out what you want to do and pay someone for it. Make sure they leave plenty of notes. Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403816 Share on other sites More sharing options...
haku Posted January 7, 2013 Share Posted January 7, 2013 That's not a bad idea at all. Just make sure you hire someone who knows what they are doing, or you could end up with a bunch of confusing code! Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403821 Share on other sites More sharing options...
Christian F. Posted January 7, 2013 Share Posted January 7, 2013 I would also recommend posting in the Freelance section here, which will give you a lot more response than in this section for this particular request. Link to comment https://forums.phpfreaks.com/topic/272770-help-with-deleting-records-using-a-form-with-checkbox-type-inputs/#findComment-1403898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.