woolyg Posted April 26, 2007 Share Posted April 26, 2007 Noobie Q here, but I just couldnt find it anywhere..! Say if I ran a query that called all rows from a table: $display = mysql_query("SELECT * FROM table"); $show = mysql_fetch_array($display); And that returned ID Name Surname Level 1 John Smith 10 2 Barry Manilow 8 3 James Brown 6 ...how would I form the PHP to display all of the above info in bold? Can someone help? I'm embarrassingly noobalicious. Link to comment https://forums.phpfreaks.com/topic/48728-simple-display-query/ Share on other sites More sharing options...
boo_lolly Posted April 26, 2007 Share Posted April 26, 2007 i don't understand how you know how to make your post text bold, but not your html... <?php $sql = " SELECT * FROM your_table "; $query = mysql_query($sql) OR die(mysql_error()); echo " <table border=\"1\"> <tr><td>ID</td><td>Name</td><td>Surname</td><td>Level</td></tr> \n"; while($row = mysql_fetch_array($query)){ echo "<tr><th>{$row['id']}</th><th>{$row['name']}</th><th>{$row['surname']}</th><th>{$row['level']}</th></tr>\n"; } echo "</table>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/48728-simple-display-query/#findComment-238838 Share on other sites More sharing options...
woolyg Posted April 26, 2007 Author Share Posted April 26, 2007 eh? I just used the code button.. but thanks a million for that - I am learning, slowly but surely.. Woolyg Link to comment https://forums.phpfreaks.com/topic/48728-simple-display-query/#findComment-238898 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.