php_begins Posted November 29, 2011 Share Posted November 29, 2011 The following code returns thousands of results separated by a semicolon; while($getpostid_result=mysql_fetch_array($getpostid)) { $postusername=$getpostid_result['username']; echo $postusername.";"; } the problem is it does not print everything in one row.it breaks into the nextline after if it encounters certain chatacters or some other reason. I want it to able to print everything in one row irrespective of the number of results returned. Quote Link to comment https://forums.phpfreaks.com/topic/252068-print-all-data-in-one-row-separated-by-semicolon/ Share on other sites More sharing options...
Pikachu2000 Posted November 29, 2011 Share Posted November 29, 2011 Other than suggesting you select the values using MySQL's TRIM() function, that's going to be hard to answer without knowing just what characters they are, and where they're located. Quote Link to comment https://forums.phpfreaks.com/topic/252068-print-all-data-in-one-row-separated-by-semicolon/#findComment-1292374 Share on other sites More sharing options...
php_begins Posted November 29, 2011 Author Share Posted November 29, 2011 well they just break randomly without any reason at times.For example: TJDaddy;gotjeep;FLHT_FXRS_YJ;jpwranglr9;sport;itsrich;OhYeah;RodeoRob;TNJeepMan;pm203;CETROV;'drack;ATeamer;Jeepchik;dooz;TJBrowder;dirtpilot;OverTheHandlebars;DCBerry;jeep thrills;OwnAccord;tpaudet;aroberts;MarkK; Quote Link to comment https://forums.phpfreaks.com/topic/252068-print-all-data-in-one-row-separated-by-semicolon/#findComment-1292378 Share on other sites More sharing options...
Drummin Posted November 30, 2011 Share Posted November 30, 2011 Not sure if a css fix will work. echo "<span style=\"white-space:nowrap;\">"; while($getpostid_result=mysql_fetch_array($getpostid)) { $postusername=$getpostid_result['username']; echo $postusername.";"; } echo "</span>"; Quote Link to comment https://forums.phpfreaks.com/topic/252068-print-all-data-in-one-row-separated-by-semicolon/#findComment-1292505 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.