Jump to content

[SOLVED] Mysql result and xml


leest

Recommended Posts

Ok,

 

I have a piece of code i have modified to take results from a database and plot them on to a google map, now the code works well, however it only display one result and doesn't seem to loopthrough the xml code, i am quite new with this type of coding and so a litle confused any pointers would be much appreciated.

 


$sql = "SELECT * FROM joborder ";
  
  $result = mysql_query($sql) or die(mysql_error());
  
  while($row = mysql_fetch_array($result)){
      
$title = $row['title'];
$city = $row['city'];
$state = $row['state'];

}

{"locations":

{"location":[

{"id":  "

 echo "$title";

",

"city": "

 echo "$title"; 

",

"location": "

 echo "$city"; 

",

"address": "

 echo "$state";

",

"date": "May 2nd, 2007"

}

]

}}

 

 

Link to comment
https://forums.phpfreaks.com/topic/102936-solved-mysql-result-and-xml/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.