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
https://forums.phpfreaks.com/topic/250903-need-help-on-php-sqlaction/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.