SHOW:
|
|
- or go back to the newest paste.
| 1 | public function getBusiness ($item) | |
| 2 | ||
| 3 | {
| |
| 4 | $row = ""; | |
| 5 | ||
| 6 | $result = mysqli_query($this->connection, "SELECT * FROM businesses"); | |
| 7 | ||
| 8 | - | echo "<?xml version=\"1.0\" ?><map>"; |
| 8 | + | $out = "<?xml version=\"1.0\" ?><map>"; |
| 9 | ||
| 10 | while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) | |
| 11 | {
| |
| 12 | - | echo "<business><businessid>" . $row["businessid"] . "</businessid>"; |
| 12 | + | $out .= "<business><businessid>" . $row["businessid"] . "</businessid>"; |
| 13 | - | echo "<type>" . $row["type"] . "</type>"; |
| 13 | + | $out .="<type>" . $row["type"] . "</type>"; |
| 14 | - | echo "<name>" . $row["name"] . "</name>"; |
| 14 | + | $out .="<name>" . $row["name"] . "</name>"; |
| 15 | - | echo "<street>" . $row["street"] . "</street>"; |
| 15 | + | $out .="<street>" . $row["street"] . "</street>"; |
| 16 | - | echo "<city>" . $row["city"] . "</city>"; |
| 16 | + | $out .="<city>" . $row["city"] . "</city>"; |
| 17 | - | echo "<country>" . $row["country"] . "</country>"; |
| 17 | + | $out .="<country>" . $row["country"] . "</country>"; |
| 18 | - | echo "<postcode>" . $row["postcode"] . "</postcode>"; |
| 18 | + | $out .="<postcode>" . $row["postcode"] . "</postcode>"; |
| 19 | - | echo "<latitude>" . $row["latitude"] . "</latitude>"; |
| 19 | + | $out .="<latitude>" . $row["latitude"] . "</latitude>"; |
| 20 | - | echo "<longitude>" . $row["longitude"] . "</longitude>"; |
| 20 | + | $out .="<longitude>" . $row["longitude"] . "</longitude>"; |
| 21 | - | echo "<phonenumber>" . $row["phonenumber"] . "</phonenumber>"; |
| 21 | + | $out .="<phonenumber>" . $row["phonenumber"] . "</phonenumber>"; |
| 22 | - | echo "<email>" . $row["email"] . "</email>"; |
| 22 | + | $out .="<email>" . $row["email"] . "</email>"; |
| 23 | - | echo "<website>" . $row["website"] . "</website>"; |
| 23 | + | $out .="<website>" . $row["website"] . "</website>"; |
| 24 | - | echo "<facebookid>" . $row["facebookid"] . "</facebookid>"; |
| 24 | + | $out .="<facebookid>" . $row["facebookid"] . "</facebookid>"; |
| 25 | - | echo "<twitterid>" . $row["twitterid"] . "</twitterid>"; |
| 25 | + | $out .="<twitterid>" . $row["twitterid"] . "</twitterid>"; |
| 26 | - | echo "<youtubeid>" . $row["youtubeid"] . "</youtubeid>"; |
| 26 | + | $out .="<youtubeid>" . $row["youtubeid"] . "</youtubeid>"; |
| 27 | - | echo "<flickrid>" . $row["flickrid"] . "</flickrid>"; |
| 27 | + | $out .="<flickrid>" . $row["flickrid"] . "</flickrid>"; |
| 28 | - | echo "<description>" . $row["description"] . "</description>"; |
| 28 | + | $out .="<description>" . $row["description"] . "</description>"; |
| 29 | - | echo "<likes>" . $row["likes"] . "</likes>"; |
| 29 | + | $out .="<likes>" . $row["likes"] . "</likes>"; |
| 30 | - | echo "<datesubmitted>" . $row["datesubmitted"] . "</datesubmitted></business>"; |
| 30 | + | $out .="<datesubmitted>" . $row["datesubmitted"] . "</datesubmitted></business>"; |
| 31 | } | |
| 32 | - | echo "</map>"; |
| 32 | + | $out .="</map>"; |
| 33 | return $out; | |
| 34 | ||
| 35 | ||
| 36 | } |