wright67uk Posted December 7, 2012 Share Posted December 7, 2012 The below query returns the correct dataset but without carriage returns, have I used "\n" correctly? $tbl_name = "snag_score"; $result = mysql_query("SELECT * FROM $tbl_name"); while($row = mysql_fetch_array($result)) { echo $row['user_id'] . "\t" . $row['total_score']. "\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/271704-n-in-sql-results/ Share on other sites More sharing options...
requinix Posted December 7, 2012 Share Posted December 7, 2012 You won't see them in HTML because whitespace, like tabs and newlines, are collapsed into single spaces. Most of the time. Use a instead, or even better put the content into an appropriate structure (table, span, div, or whatever) and style that as you want. Link to comment https://forums.phpfreaks.com/topic/271704-n-in-sql-results/#findComment-1398046 Share on other sites More sharing options...
wright67uk Posted December 7, 2012 Author Share Posted December 7, 2012 Thankyou. Link to comment https://forums.phpfreaks.com/topic/271704-n-in-sql-results/#findComment-1398063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.