Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Delete data from database table in php

Sun Oct 26, 2008 7:08 pm

Code:
<?php
   mysql_connect
("server","user","password");
   
mysql_select_db("dbname");

   
$rowID "001";
   
$query "DELETE FROM Employee WHERE ID='$rowID'";
   
$result mysql_query($query);

   if ((
mysql_affected_rows() == 0) || mysql_affected_rows() == -1) {
        echo 
"<p>There was a problem deleting some of the selected items.</p>";
        exit;
   }
?>





Post a reply
  Related Posts  to : Delete data from database table in php
 Delete data from database by ID in php     -  
 need help building table in my database!     -  
 List Database, Table, and Field in php     -  
 Displaying images from database instead of the url from data     -  
 How to fill a ComboBox with data from a database in jsp     -  
 NULL Data in table     -  
 database contents display in table format in swing     -  
 Display data from database as Tree Structure in JSP     -  
 Loading table data from a CSV file     -  
 show table data by clicking button     -  

Topic Tags

PHP Database