I should get output in xml format

AdamSmith

New Member
\[code\] <?php $sql = "select jobtitle from jobslist"; $result = mysql_query($sql,$con); if($result) { while($row=mysql_fetch_array($result)) { $jobtitle = $row["jobtitle"]; echo $jobtitle."<br/>"; //output should be in xml format as given below } } ?>\[/code\]in above code i am printing jobtitle as simple text using "echo"but i want the output in xml format ..that is i should get output as below\[code\] <all> <jobtitle>job1</jobtitle> <jobtitle>job2</jobtitle> </all>\[/code\]please any one let me know how can i achieve this...curently i get output as\[code\] job1 job2\[/code\]
 
Back
Top