junaooaks 3 Denunciar post Postado Fevereiro 6, 2008 galera tem como fazer um if dentro do if assim if ($a ==1){ $sql = " consulta banco de dados"; if (){ } } esta gambiarra funciona ? Compartilhar este post Link para o post Compartilhar em outros sites
junaooaks 3 Denunciar post Postado Fevereiro 6, 2008 funciona heheheheh http://forum.imasters.com.br/public/style_emoticons/default/clap.gif mas eu to tendo um probleminha esta triplicando o resultado olha o codigo: if ($status == 1 ) $mysql = "SELECT * FROM relacionamento, clientes WHERE clientes.id = relacionamento.id_cliente"; $mysql = mysql_query($mysql) or die (mysql_error()); //resultado na tela while ($linha = mysql_fetch_array($mysql)){ $kb = $linha ['kb']; if ($kb == 1){ $kb1 = '64K'; // Escrever dentro do arquivo.txt $escreve = fwrite($fp, "$mac Auth-Type = Local, Password = \"\"\r\n Mikrotik-Rate-Limit = $kb1\r\n");} if ($kb == 2){ $kb2 = '128k'; // Escrever dentro do arquivo.txt $escreve = fwrite($fp, "$mac Auth-Type = Local, Password = \"\"\r\n Mikrotik-Rate-Limit = $kb2\r\n");} if ($kb == 3){ $kb3 = '256k'; // Escrever dentro do arquivo.txt $escreve = fwrite($fp, "$mac Auth-Type = Local, Password = \"\"\r\n Mikrotik-Rate-Limit = $kb3\r\n");} } } // Fecha o arquivo fclose($fp); está gerando um relatorio triplicado : 00:55:22:66:88:55 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 64K 00:55:22:66:88:55 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 128k 00:55:22:66:88:55 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 256k 00:55:22:66:88:58 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 64K 00:55:22:66:88:58 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 128k 00:55:22:66:88:58 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 256k 00:AF:DB:22:33:45 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 64K 00:AF:DB:22:33:45 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 128k 00:AF:DB:22:33:45 Auth-Type = Local, Password = "" Mikrotik-Rate-Limit = 256k agradeço quem puder me ajudar Compartilhar este post Link para o post Compartilhar em outros sites
JackDenio 0 Denunciar post Postado Fevereiro 6, 2008 Talvez nem seja essa razão ..mas deixa essa parte assim: $sql = "SELECT * FROM relacionamento, clientes WHERE clientes.id = relacionamento.id_cliente"; $exe = mysql_query($sql) or die (mysql_error()); //resultado na tela while ($linha = mysql_fetch_array($exe)){ Compartilhar este post Link para o post Compartilhar em outros sites