I have a 2 tables, users and short_style.
Fields of table users:
id int  primary  not null auto increment
username
password
firstname
lastname
data inserted by users to table users:
users
id     username     password     firstname     lastname   
1      jsmith       md5hash      john          smith 
2      jbrown       md5hash      jane          brown 
data inserted by users to table short_style:
short_style
id     style_name     style_cost     style_time     number_of_styles   
1      bald           10             30             1
2      wash           5              15             2   
1      shave          12             30             3   
2      line           8              15             4   
1      wash           Free           15             6   
2      color          20             30             7   
I can have the users add a new style, that code works perfect.
I can have the users update their data as well, that code works perfect.
I'm stuck at deleting user data as I have no idea how to target the number_of_styles data, as that is the only unique data.
From what I have learned (in this short time) the DELETE only take 2 parameters, the Table name and the Table row (I'm assuming).
How can I make this work?
Sorry for the long html, I still haven't figured out how to show html in the comments. What I have:
<?php
if (isset($_POST['delete_servicename'])&&
isset($_POST['update_category'])) {
$delete_servicename = $_POST['delete_servicename'];
$category = $_POST['update_category'];
$atta = '_name';
$delete = "$category$atta";
$query = "SELECT $delete  FROM $category     WHERE `id`='".$_SESSION['user_id']."'";
$query_run = mysql_query($query);
if(mysql_num_rows($query_run)==1) {
$dquery = "DELETE FROM $category WHERE $id = '".$_SESSION['user_id']."'";
 }
}
?>
<form action="services_update.php" method="POST">
  <div class="a_u_d_sort">
    <ul>
      <li class="a_u_d_sort_left">
        <p>Category:</p>
      </li>
      <li class="a_u_d_sort_right">
        <select name="update_category">
          <option value="">select</option>
          <option value="short_style">Short Style</option>
          <option value="medium_style">Medium Style</option>
          <option value="long_style">Long Style</option>
          <option value="other_services">Other Service</option>
        </select>
      </li>
     </ul>
   </div>
   <div class="a_u_d_sort">
    <ul>
      <li class="a_u_d_sort_left">
        <p>Service Name:</p>
      </li>
      <li class="a_u_d_sort_right">
        <input type="text" name="delete_servicename"></input>
      </li>
     </ul>
    </div>
    <button class="add" type="submit">Delete</button>
  </form>
 
     
    