I'm an experienced ASP/MSSQL programmer trying to make the move to PHP/MYSQL and I've been able to wrangle my way up to now. I have a simple SQL query that works great in mymcadmin but gets lost in PHP. I've simplified it a bit here but this is the actual code. Any help would be appreciated!
CODE
<?php
ini_set('display_errors','1');
//connect to database
$con=mysqli_connect("000.00.00.00","0000000000","0000000000","000000000");
if (mysqli_connect_errno()) {
echo '<font color=red>' . mysqli_connect_error() . '</font>';
}
$xml='';
$sql = "SELECT zip FROM tax LIMIT 0 , 10";
$result = mysqli_query($con,$sql);
while ($row = mysqli_fetch_array($result)) {
$xml+='<row>';
$xml+='<zip>' . $row['zip'] . '</zip>';
$xml+='</row>';
}
mysqli_close($con);
echo '<?xml version="1.0"?>';
echo '<root>' . $xml . '</root>';
?>
EXPECTED OUTPUT
<?xml version="1.0"?>
<root>
<row>00000</row>
...
</root>
ACTUAl OUTPUT
<?xml version="1.0"?>
<root>0</root>