kristinhot
New Member
I'm a complete novice, and have been asked to finish a project for someone (much more knowledgeable than I) who has just left. I currently have a MySQL database, which I am trying to export as an XML file. This is going fine, but unlike PHP, I can't combine two separate columns. So where I have two entries - lat (latitude), and Lon (longitude) - in my MySQL database, I can't output them in XML as one entry. In PHP I would simply write: \[code\]$latlon = $lat.",".$lon;\[/code\]But I cannot do so in the XML output below. Does anyone know how I could write this to achieve the required result, of simply having two entries listed under one child?\[code\]function createxml($x) { global $mysqli; include('xml.php'); $sxe = new SimpleXMLElement($xmlstr);//get mysql dataif ($result = $mysqli->query("SELECT id,county,main_page,lat,lon,volume,texty,pdf,thumb FROM texts3 ORDER BY id ASC LIMIT $x")) { //found volumes already in DB while ($r = $result->fetch_array(MYSQLI_BOTH)) { $record = $sxe->addChild('record'); $record->addChild('latitude', $r['lat']); $record->addChild('longitude', $r['lon']); $record->addChild('latlon', $r['']); } $result->close();}\[/code\]