I wrote a module for the DLE admin with my clumsy handles) At the last stage, there was a problem with the cycle. He does not want to work when inserting the code. In the example below, the beginning and end of a piece of code with which the cycle works and without which it works is marked with comments.
$db->query("SELECT * FROM ".USERPREFIX."_orders"); while($row = $db->get_row()) { /* НАЧАЛО ЕРУНДЫ */ $user_id = $row['user_id']; $order_id = $row['order_id']; $db->query("SELECT name FROM ".USERPREFIX."_users WHERE user_id = '$user_id'"); $b = $db->get_row(); $db->query("SELECT * FROM ".USERPREFIX."_order WHERE id = '$order_id'"); $c = $db->get_row(); /* КОНЕЦ */ echo '<tr> <td>'.$b['name'].'</td> <td>'.$c['title'].'</td> <td>'.$c['price_usd'].'</td> <td>'.$c['price_eur'].'</td> <td>'.$c['price_rub'].'</td> <td><a href="'.$module.'&end='.$row['id'].'">'.($row['is_end'] == 0 ? 'Нет': 'Да').'</a></td> <td><a href="'.$module.'&delete='.$row['id'].'"><img src="'.$config['http_home_url'].'engine/skins/images/delete.png" alt="Удалить" /></a></td> </tr>'; }
As if everything is fine with this code, but the loop prints only one line from the database. Without it, it outputs as much as there is, but here is $ b, $ c, etc. does not work. Help me please!