anonīms Posted February 10, 2008 Report Share Posted February 10, 2008 foreach ($server_list as $server) { $misc = lgsl_server_misc($server); $server = lgsl_server_html($server); $alldata = mysql_query("SELECT * FROM serveri ORDER BY id ASC"); $col = 0; while ( $row = mysql_fetch_array($alldata ) ) { $col++; if ( $col % 2 == 0 ) { $color = 'FFFFEE'; } else { $color = 'EEFFFF'; } echo " <tr bgcolor='#".$color."'> <td><a href='#servera_info' title='{$misc['text_status']} | {$misc['text_type_game']}'>{$server['b']['ip']}:{$server['b']['c_port']}</a></td> <td>{$misc['name_filtered']}</td> <td>{$server['s']['map']}</td> <td>{$server['s']['players']} / {$server['s']['playersmax']}</td> </tr>"; } } Kā varētu viņus apvienot, lai visu neizvadītu divas reizes? Link to comment Share on other sites More sharing options...
marcis Posted February 11, 2008 Report Share Posted February 11, 2008 Ko tavā uztverē nozīmē apvienot? Bet izskatās, ka tu pie katra masīva elementa selektē visu no datubāzes pa jaunu (tb visu laiku vienu un to pašu). Link to comment Share on other sites More sharing options...
anonīms Posted February 11, 2008 Author Report Share Posted February 11, 2008 Kļūda labota, izdomāju kā izveidot bez while Link to comment Share on other sites More sharing options...
Delfins Posted February 11, 2008 Report Share Posted February 11, 2008 tāpat tie tavi cikli nepareizi... N-x viens un tas pats SQL izpildās bezjēgā. Link to comment Share on other sites More sharing options...
Recommended Posts