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 }?> Link to comment https://forums.phpfreaks.com/topic/6384-delete-record/ Share on other sites More sharing options...
play_ Posted April 2, 2006 Share Posted April 2, 2006 delete * from table where whatever=something Link to comment https://forums.phpfreaks.com/topic/6384-delete-record/#findComment-23092 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 Link to comment https://forums.phpfreaks.com/topic/6384-delete-record/#findComment-23103 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.