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? Link to comment https://forums.phpfreaks.com/topic/216986-beginner/ 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)) { Link to comment https://forums.phpfreaks.com/topic/216986-beginner/#findComment-1127034 Share on other sites More sharing options...
mrjoaopereira Posted October 27, 2010 Author Share Posted October 27, 2010 TY TY! Link to comment https://forums.phpfreaks.com/topic/216986-beginner/#findComment-1127037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.