unknown87 Posted November 4, 2008 Share Posted November 4, 2008 $user_id=$_SESSION['user_id']; $query = "SELECT first_name FROM players WHERE user_id = '$user_id'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "Player: " . $row['first_name'] . "<br>"; } I need the information i'm getting from the database to be put into table format. Can someone tell me how I can achieve this. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/131374-displaying-data-from-database-in-table-format/ Share on other sites More sharing options...
Michdd Posted November 4, 2008 Share Posted November 4, 2008 $user_id=$_SESSION['user_id']; $query = "SELECT first_name FROM players WHERE user_id = '$user_id'"; $result = mysql_query($query) or die(mysql_error()); echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr><td>Player:</td><td> " . $row['first_name'] . "</td></tr>"; } echo "</table>"; Link to comment https://forums.phpfreaks.com/topic/131374-displaying-data-from-database-in-table-format/#findComment-682262 Share on other sites More sharing options...
unknown87 Posted November 4, 2008 Author Share Posted November 4, 2008 thank you very much Link to comment https://forums.phpfreaks.com/topic/131374-displaying-data-from-database-in-table-format/#findComment-682278 Share on other sites More sharing options...
Michdd Posted November 4, 2008 Share Posted November 4, 2008 thank you very much You're welcome. Link to comment https://forums.phpfreaks.com/topic/131374-displaying-data-from-database-in-table-format/#findComment-682285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.