Jump to content

[SOLVED] Need help merging code


Dada78

Recommended Posts

I am not sure how to merge this. I have tried but was unable to get it to work. What I am needing to do is add the $rows below

 

$row["city"] $row["state"] $row["postal"]

 

Need to add to this below behind row["address"]

 

echo 'address="' . parseToXML($row['address']) . '" ';

 

If anyone can help me out with this that would be great!

 

-Thanks

Link to comment
https://forums.phpfreaks.com/topic/88533-solved-need-help-merging-code/
Share on other sites

Try,

 

<?php
echo 'city="'. parseToXML($row["city"]) .'" state="'. parseToXML($row["state"]) .'" postal="'. parseToXML($row["postal"]) .'" address="' . parseToXML($row['address']) . '"';
?>

 

I'm not sure if by behind you meant before, sorry :/

Yea I think I need to be more clear. I need to merge this

 

$row["city"] $row["state"] $row["postal"]

 

Behind this.

 

$row['address']

 

Something like this but this doesn't work.

 

echo 'address="' . parseToXML($row['address'], $row["city"], $row["state"], $row["postal"]) . '" ';

 

I need all that to be included in the variable address above. Hope that makes sense.

Thank, that works but will a small issue.

 

If you go to

 

http://www.mesquitechristmas.com/local/phpsqlajax_genxml2.php

 

You will notice it is showing an error because their is no space before lat=. Not sure how to add a space to that.

 

// ADD TO XML DOCUMENT NODE
  echo '<marker ';
  echo 'displayname="' . parseToXML($row['displayname']) . '" ';
  echo 'address="'. parseToXML($row["address"]) .' '. parseToXML($row["city"]) .' '. parseToXML($row["state"]) .' ' . parseToXML($row['postal']) . '"';
  echo 'lat="' . $row['lat'] . '" ';
  echo 'lng="' . $row['lng'] . '" ';
  echo '/>';
}

// End XML file

 

 

Any idea what I need to do?

 

 

 

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.