Jump to content

speedftw

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

speedftw's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes, I didn't explain well what I was trying to say. So, I do the queries and the do a loop which get the output from each query. Now, how do I concatenate the output?
  2. That's exactly what I need. But I don't know how to concatenate all the results from the queries.
  3. As I try to explain because the fields that I need for each point are not acessible from a single query. The Instance table has: - id - id_asset - id_model - source - latitude - longitude - pollution Example of instance: id | id_asset | id_model | source | latitude | longitude| pollution 1 100 NULL SD 42,4 2,2 NULL 2 100 3 HD NULL NULL Medium 3 22 12 HD NULL NULL High So, for the same asset (place) that I want to put in the kml file I have the information in the same table but in different rows. If I do as you said I get no results from the query. Besides, I have more queries that I want to do not just these two.
  4. I don't know how to make a 2d array from the results of the queries.
  5. I'm trying to use php and postgresql to generate a kml file (google earth) that have information of multiples places. So I have multiples queries to retrieve all the information that I need. Example: SELECT c.latitude, c.longitude FROM Circuit AS b, Instance AS c, InstanceNumber AS d WHERE c.id = d.Instance AND d.Circuit = b.id AND b.code = 'Z3D2' SELECT c.number, b.model, e.pollution FROM Asset AS a, Model AS b, TowerNumber AS c, Line AS d, Instance AS e WHERE COALESCE(a.Model,0)=b.id AND c.Asset=a.id AND a.Line=d.id AND e.Asset=a.id AND e.Source=1 AND d.name='Z3D2' The field "number" in both TowerNumber and InstanceNumber should be similar. I can't get all the information with just one query because some field are null for Instance.source and others are not. Besides that the foreign Keys that connect tables are not filled in all tables so I have to do different "ways" to get the information. 1st: Line->Asset->TowerNumber->Instance 2nd: Line->Circuit->InstanceNumber->Instance For Source='SD'which as 'latitude' and 'longitude' I have two use the 1st path. For the other information that have Source="HD" I've to use the 2nd path. I have these two queries as an example. What I want to do is get the information in this two queries and create and array like: number | model | pollution | latitude | longitude 0 | ZD1 | 7 | 48,48 | 2,22 1 | H3 | 6 | 48,49 | 2,24 ... | ... | ... | ... | ... And then I'll just write that information to the kml file where each place should have all the information and should look like: <Placemark> <name>$table[number]</name> <ExtendedData> <Data name=name_field_1> <value>$table[model]</value> </Data> <Data name=name_field_2> <value>$table[pollution]</value> </Data> ... ... <Point><coordinates>$table[longitude],$table[latitude]</coordinates></Point> </Placemark>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.