Home · PHP Scripts · delete data from a mysql database

cms-zen dot com

online web development :: art and design :: fun stuff
best-budd
sNews Development cms road trip PHP Scripts Photoshop Guides Css Guides Music and video clips Art Gallery Low Light Photography Impression Photography

delete data from a mysql database

This php script will delete data from a mysql database.

  <?php

/*
* Change the first line to whatever
* you use to connect to the database.
*
* Change tablename to the name of your 
* database table.
*
* This example would delete a row from
* a table based on the id of the row.
* You can change this to whatever you
* want.
*/

    // Your database connection code
    
db_connect();

    
$query "DELETE FROM tablename WHERE id = ('$id')";

    
$result mysql_query($query);

    echo 
"The data has been deleted.";

?>   

30.12.2006. 11:35