Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

search update delete record in mysql table using a form

$
0
0

hello all, 

 

i have a form named del_prod.php containing a search delete and update button. i want to know

  • how i can perform my search by inserting the product id in the product id field and related record is displayed in the textfields in the form.
  • delete the record from mysql table
  • update the record as well

this is my del_prod.php page code

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Delete Product</title>
 
<link href="CSS/del_prod.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
 
<div id="stylized" class="myform">
 
<form id="form" name="del_prod" method="post" action="delprod.php">
 
<h2 align="center"><b>- Delete / Update Product -</b></h2>
 
<table width="1000" border="0">
  <tr>
    <td><div align="right">Product ID</div></td>
    <td><input type="text" name="prod_id" id="prod_id"/></td>
  </tr>
  <tr>
    <td><div align="right">Product Name</div></td>
    <td><input type="text" name="prod_name" id="prod_name" /></td>
  </tr>
  <tr>
    <td><div align="right">Product Brand</div></td>
    <td><input type="text" name="prod_brand" id="prod_brand"/></td>
  </tr>
  <tr>
    <td><div align="right">Product Description</div></td>
    <td><textarea name="prod_desc" id="prod_desc" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td><div align="right">Product Price (MRU)</div></td>
    <td><input type="text" name="prod_price" id="prod_price"/></td>
  </tr>
  <tr>
    <td><div align="right">Product Category</div></td>
    <td><input type="text" name="cat" id="cat"/></td>
  </tr>
  <tr>
    <td><div align="right">Product Subcategory</div></td>
    <td><input type="text" name="subcat" id="subcat"/></td>
  </tr>
  <tr>
    <td><div align="right">Product Weight/Capacity</div></td>
    <td><input type="text" name="prod_w_c" id="prod_w_c"/></td>
  </tr>
  <tr>
    <td><div align="right">Uploaded Photo Path</div></td>
    <td><input type="text" name="prod_photo" id="prod_photo"/></td>
  </tr>
</table>
 
<p align="center">
  <input type="submit" class="button" name="search" id="search" value="<-- Search -->" />
  <input type="submit" class="button" name="delete" id="delete" value="<-- Delete product -->" />
  <input type="submit" class="button" name="update" id="update" value="<-- Update product -->" />
</p>
 
</form>
 
</div>
 
</body>
</html>

Viewing all articles
Browse latest Browse all 13200

Trending Articles