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"; } ?> Quote 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 (edited) 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. Edited December 7, 2012 by requinix Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/271704-n-in-sql-results/#findComment-1398063 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.