deth4uall Posted December 5, 2007 Share Posted December 5, 2007 Okay, I got a slight problem... I have been searching how to show the table info from a SQL Table, and I want it to show me all the row names as well as their values no matter what table I select from which I will put into a HTML Table... SELECT * FROM `UserInfo` WHERE `id` = '1'; $rowz = mysql_fetch_array($result); echo "<table>"; while (list($key, $value) = each($rowz)) { echo "<tr><td>".$key."</td><td>".$value."</td></tr>"; } echo "</table>"; It gives me a good result but has extra stuff I don't need: 0 1 id 1 1 deth4uall name deth4uall as you can notice it not only gives me the row and value but also an increment for some reason... :S Any suggestions to how to get rid of it? Quote Link to comment Share on other sites More sharing options...
trmbne2000 Posted December 5, 2007 Share Posted December 5, 2007 $rowz = mysql_fetch_assoc($result); Should work for you. Quote Link to comment Share on other sites More sharing options...
deth4uall Posted December 5, 2007 Author Share Posted December 5, 2007 thanks! I should have thought of that! 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.