Ir para conteúdo
Fórum Script Brasil

IDR

Membros
  • Total de itens

    6
  • Registro em

  • Última visita

Sobre IDR

IDR's Achievements

0

Reputação

  1. consegui ajeitar vlw cara! Me ajudou muito! abraços.
  2. deu certo, mas os resultados não ficam organizados. eu queria na forma de um tabela: PARTIDA CHEGADA ROTA DISTANCIA resultado 1 resultado2 etc.. Vlw!
  3. Montei esse sistema de busca e está funcionando. Só tem um problema ele só mostra 1. eu tentei colocar um sistema para mostrar mais resultados. Só q não deu. Codigo do que está funcionando: <?php @define ("MYSQL_CONNECT_INCLUDE", "connect_db.php"); // MySQL database connection (a sample file is included) $colname_Recordset1 = "-1"; if (isset($_GET['partida'])) { $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['partida'] : addslashes($_GET['partida']); } include(MYSQL_CONNECT_INCLUDE); $query_Recordset1 = sprintf("SELECT * FROM rotas WHERE partida = '%s' ORDER BY id DESC", $colname_Recordset1); $Recordset1 = mysql_query($query_Recordset1) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Resultado</title> </head> <body> <table width="606" border="1"> <tr> <td>partida</td> <td>chegada</td> <td>rota</td> <td>distancia</td> </tr> <tr> <td><?php echo $row_Recordset1['partida']; ?></td> <td><?php echo $row_Recordset1['chegada']; ?></td> <td><?php echo $row_Recordset1['rota']; ?></td> <td><?php echo $row_Recordset1['distancia']; ?></td> </tr> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> alguém tem uma soluçao?
  4. IDR

    problemas com imagem dinamica

    agora estou com outro problema como seleciono só o Piloto X para executar esse codigo e como criar um codigo desse para cada pilto da Cia.
  5. IDR

    problemas com imagem dinamica

    vlw pessoal. o SQL_Result: não era isso tava errrado era msql_num_rows() o resto vlw pela ajuda ! :grin: ta resolvido! foi so editar o seguinte: $result = mysql_query( $sql ); $dados = mysql_fetch_assoc($result); f (mysql_numrows($result) == 0) { ($im = ImageCreateFromPng("off.png")); } elseif ($dados['phase'] == 1 ) { $im = ImageCreateFromPng("embarque.png"); // Boarding
  6. <?php $hostName = "localhost"; header("Content-type: image/png"); /* CHANGE THESE LINES BELOW TO YOUR DETAILS */ $userName = ""; $password = ""; $dbName = ""; /* make connection to database */ mysql_connect($hostName, $userName, $password) or die("Unable to connect to host $hostName"); mysql_select_db($dbName) or die("Unable to select database $dbName"); $sql = "SELECT lat, lon, alt, gs, IATA, phase FROM positions WHERE last_update > DATE_SUB( NOW() , INTERVAL 15 MINUTE )"; $result = mysql_query( $sql ); $phase = ' phase '; /* mysql error */ if (!$result) { mysql_close(); die("Error - Database Connection."); } if (mysql_result($result) == 0) { ($im = ImageCreateFromPng("off.png")); } elseif ($phase = 1) { $im = (mysql_result($result,"phase") == 1 ); $im = ImageCreateFromPng("embarque.png"); // Boarding } elseif ($phase = 2) { $im = (mysql_result($result,"phase") == 2 ); $im = ImageCreateFromPng("taxidosgates.png"); // Taxi From Gate } elseif ($phase = 3) { $im = (mysql_result($result,"phase") == 3 ); $im = ImageCreateFromPng("decolando.png"); // Departing } elseif ($phase = 4) { $im = (mysql_result($result,"phase") == 4 ); $im = ImageCreateFromPng("subida.png"); // Climbing } elseif (mysql_result($result,"phase") == 5 ) { $im = (mysql_result($result,"phase") == 5 ); $im = ImageCreateFromPng("cruzeiro.png"); // Cruising } elseif ($phase = 6) { $im = (mysql_result($result,"phase") == 6 ); $im = ImageCreateFromPng("descida.png"); // Descending } elseif ($phase = 7) { $im = (mysql_result($result,"phase") == 7 ); $im = ImageCreateFromPng("landed.png"); // Landed } elseif ($phase = 8) { $im = (mysql_result($result,"phase") == 8 ); $im = ImageCreateFromPng("taxiparagates.png"); // Taxi To Gate } elseif ($phase = 9) { $im = (mysql_result($result,"phase") == 9 ); $im = ImageCreateFromPng("chegadagate.png"); // Arrived at Gate } else { $im = (mysql_result($result,"phase") == 0 ); $im = ImageCreateFromPng("off.png"); //montar erro aqui, tipo se não ler os acima coloca aqui imagem: online } //|ImageCreateFromPng("off.png"); //header("Content-type: image/png"); //$string = "Foo"; //$im = imagecreatefrompng("images/button1.png"); //$orange = imagecolorallocate($im, 220, 210, 60); //$px = (imagesx($im) - 7.5 * strlen($string)) / 2; //imagestring($im, 3, $px, 9, $string, $orange); // imagepng($im); // imagedestroy($im); // ?> estou com esse codigo mas só aprece a imagem OFF mesmo quando o PHASE no BD ta 1 ou 2 etc...
×
×
  • Criar Novo...