'; } } elseif ($_GET['step'] == 2) { $sp = mysql_query( 'SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . mysql_real_escape_string($dng) . '" ORDER BY `id` ASC' ); while ($pl = mysql_fetch_assoc($sp)) { $sql .= array_to_sql('dungeon_obj', $pl, 'id', 'NULL') . '
'; } } elseif ($_GET['step'] == 3) { $sm = 200; // смещение ботов $botadd = []; $sp = mysql_query( 'SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . mysql_real_escape_string($dng) . '" ORDER BY `id2` ASC' ); while ($pl = mysql_fetch_assoc($sp)) { $botsel = mysql_fetch_assoc( mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1') ); if (isset($botsel['id'])) { $pl['id_bot'] += $sm; if (!isset($botadd[$pl['id_bot']])) { $botadd[$pl['id_bot']] = true; $sql .= array_to_sql('test_bot', $botsel, 'id', '"' . $pl['id_bot'] . '"') . '
'; } $sql .= array_to_sql('dungeon_bots', $pl, 'id2', 'NULL') . '
'; } } } echo $sql;