sugnadesign Posted April 2, 2006 Share Posted April 2, 2006 How do I Delete a Record from the DB:Here is my code:I would like to delete using the <li>Delete</li>Thanks all Sugna <?php $sql = "SELECT requestName,requestEmail,requestPhone,requestComment,requestTypeDescr,requestDate FROM request r INNER JOIN mstrRequestType mrt ON r.requestTypeID = mrt.requestTypeID ORDER BY requestTypeDescr DESC"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) {?> <ul> <li>Delete</li> <li><strong>Name:</strong> <?php echo $row['requestName']; ?></li> <li><strong>Email:</strong> <?php echo $row['requestEmail']; ?></li> <li><strong>Phone:</strong> <?php echo $row['requestPhone']; ?></li> <li><strong>Comment:</strong> <?php echo $row['requestComment']; ?></li> <li><strong>Request Type:</strong> <?php echo $row['requestTypeDescr']; ?></li> <li><strong>Request Date:</strong> <?php echo date("m/d/Y",strtotime($row['requestDate'])); ?></li> </ul><?php }?> Quote Link to comment Share on other sites More sharing options...
play_ Posted April 2, 2006 Share Posted April 2, 2006 delete * from table where whatever=something Quote Link to comment Share on other sites More sharing options...
shortj75 Posted April 2, 2006 Share Posted April 2, 2006 mysql_query("delete from your_table where your_column='the_id_you_are_calling_to_delete'") or die (mysql_error());[code]examplemysql_query("delete from request r where r.requestTypeID='mrt.requestTypeID'") or die (mysql_error());[/code]everything that is in the column where r.requestTypeID = 'mrt.requestTypeID' will be deleted Quote Link to comment 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.