mrjoaopereira Posted October 27, 2010 Share Posted October 27, 2010 Hi guys, sorry for the beginner issues here. after following a tutorial i come across a little problem! Everything works just fine, no errors but my page source only shows the xml tags and not the actual products <?php $link = mysql_connect("localhost","Joao","password"); mysql_select_db("brimelow_store"); $query = 'SELECT * FROM products'; $results = mysql_query($query); echo "<?xml version=\"1.0\"?>\n"; echo "<products>\n"; while ($line = mysql_fetch_assoc($results)); { echo "<item>" . $line["product"] . "</item>\n"; } echo "</products>\n"; mysql_close($link); ?> source = <?xml version="1.0"?> <products> <item></item> </products> I have checked the database names and they all match... im confused. can i get some help pls? Quote Link to comment Share on other sites More sharing options...
mds1256 Posted October 27, 2010 Share Posted October 27, 2010 the while loop.... remove the semicolon and it works while ($line = mysql_fetch_assoc($results)); { should be while ($line = mysql_fetch_assoc($results)) { Quote Link to comment Share on other sites More sharing options...
mrjoaopereira Posted October 27, 2010 Author Share Posted October 27, 2010 TY TY! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.