Jump to content

need help on php-sqlaction


buladex

Recommended Posts

im making this tool to clean up some data from a sql database, i made a php code to list what i need, thats player name,lvl and id from  table_A, the problem is i want to delete from  table_A and from table_B all the results from php code , they have in common the id and as a condition the lvl must be lower then 10, it seems i cant make it delete from table_B also,please help me!!

 

a button of the end of the page to delete all that includes same id from both tables is what im looking for!

Link to comment
Share on other sites

<table<?php echo $tableSet; ?>>
  <tr>
    <td width="*" align="center">Rank</td>                                       
    <td width="*" align="center"><font color="#000000">Name</td>
   <td width="*" align="center"><font color="#000000">money</td>
   <td width="*" align="center"><font color="#000000">id</td>
   <td width="*" align="center"><font color="#000000">lvl</td>


  </tr>
  
<?php				
$rank = mysql_query('SELECT name,money,id,level  FROM table_A  WHERE level < 10 '
      .' ORDER by level desc LIMIT '.$limit.';');
$i=1;
while ($row = mysql_fetch_array($rank)) {
	echo '<tr><td align="center">'.$i.'.</td>
      <td align="center"><font color="#0000FF">'.$row['name'].'</td>
  <td align="center"><font color="#0000FF">'.$row['money'].'</td>
  <td align="center"><font color="#0000FF">'.$row['id'].'</td>
      <td align="center"><font color="#FF0000">'.$row['level'].'</td>

    </tr> ';
    $i++;
    }
?>

this is showing which player names goes to id(from table_A)

i need to delete from table_a where the ids shown are lower then lvl 10(the ones result from code above) and same ids from table_b

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.