buladex Posted November 10, 2011 Share Posted November 10, 2011 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 More sharing options...
trq Posted November 11, 2011 Share Posted November 11, 2011 Post your code. Link to comment https://forums.phpfreaks.com/topic/250903-need-help-on-php-sqlaction/#findComment-1287275 Share on other sites More sharing options...
buladex Posted November 11, 2011 Author Share Posted November 11, 2011 <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 https://forums.phpfreaks.com/topic/250903-need-help-on-php-sqlaction/#findComment-1287313 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.