Ver Mensaje Individual
  #15 (permalink)  
Antiguo 04/07/2013, 05:13
carlosuc99
 
Fecha de Ingreso: junio-2011
Mensajes: 342
Antigüedad: 12 años, 10 meses
Puntos: 5
Respuesta: Google maps y for PHP

Vale, las polylines de momento no funcionan pero se la causa o una de las causas.

Fijaos en el query del segundo for:

Código PHP:
Ver original
  1. $query5 = mysql_query("SELECT * FROM routes WHERE from='$icao'");

Originalmente se llamaba $query pero lo cambié por los problemas que daba.

Ese query no funciona. Puedo buscarlo de cualquier manera menos donde WHERE from o to. Con esas dos columnas siempre falla el query. Lo puedo buscar por flight... y no fallará. Pero por from o to que son las que me hacen falta falla.

Os dejo una exportacion MySQL de la tabla:

Código:
-- phpMyAdmin SQL Dump
-- version 3.5.8.1
-- http://www.phpmyadmin.net
--
-- Host: 10.246.16.183:3306
-- Generation Time: Jul 04, 2013 at 11:16 AM
-- Server version: 5.1.66-0+squeeze1
-- PHP Version: 5.3.3-7+squeeze15

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Database: `americanairline`
--

-- --------------------------------------------------------

--
-- Table structure for table `routes`
--

CREATE TABLE IF NOT EXISTS `routes` (
  `route_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `flight` varchar(7) NOT NULL,
  `from` varchar(4) NOT NULL,
  `to` varchar(4) NOT NULL,
  `alternative` varchar(4) DEFAULT NULL,
  `etd` varchar(4) DEFAULT NULL,
  `eta` varchar(4) DEFAULT NULL,
  `fleettype_id` int(10) DEFAULT NULL,
  `pax` int(11) DEFAULT NULL,
  `price` int(11) DEFAULT NULL,
  `flproute` varchar(500) NOT NULL,
  `comments` varchar(500) DEFAULT NULL,
  `booked` tinyint(4) NOT NULL,
  `cargo` varchar(10) NOT NULL,
  `fuel` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`route_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=31 ;

--
-- Dumping data for table `routes`
--

INSERT INTO `routes` (`route_id`, `flight`, `from`, `to`, `alternative`, `etd`, `eta`, `fleettype_id`, `pax`, `price`, `flproute`, `comments`, `booked`, `cargo`, `fuel`) VALUES
(29, 'AAL1123', 'LEVX', 'KLAX', NULL, NULL, NULL, NULL, NULL, NULL, '', '', 0, '', 0),
(30, 'ALL1236', 'KLAX', 'LEMD', NULL, NULL, NULL, NULL, NULL, NULL, '', '', 0, '', 0);
PD: Si le hago
Código PHP:
Ver original
  1. echo mysql_num_rows($query5);
y esta en from o to. No da resultado y si esta en otro te dará como mínimo 0. De la otra manera no pone nada.