carley_bell Posted January 22, 2009 Share Posted January 22, 2009 Hi, my results page displays "This user has been locatedUserid: BlahBlahfName: BlahBlahlName: BlahBlah" instead of: This user has been located Userid: BlahBlah fName: BlahBlah lName: BlahBlah How do I fix the code to make this formatting change? while ($row= mysql_fetch_array($result)) { { echo " This user has been located"; echo "<b>Userid: </b>" . $row['field_1']; echo "<b>fName: </b>" . $row['field_2']; echo "<b>lName: </b>" . $row['field_3']; } Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/141964-solved-how-do-you-echo-multiple-results-displayed-one-below-the-other/ Share on other sites More sharing options...
premiso Posted January 22, 2009 Share Posted January 22, 2009 while ($row= mysql_fetch_array($result)) { { echo " This user has been located<br />"; echo "<b>Userid: </b>" . $row['field_1'] . "<br />"; echo "<b>fName: </b>" . $row['field_2']. "<br />"; echo "<b>lName: </b>" . $row['field_3'] . "<br />"; } Quote Link to comment https://forums.phpfreaks.com/topic/141964-solved-how-do-you-echo-multiple-results-displayed-one-below-the-other/#findComment-743337 Share on other sites More sharing options...
carley_bell Posted January 22, 2009 Author Share Posted January 22, 2009 OMG I tried that..I was just putting it outside the "'s Thank you!!! Quote Link to comment https://forums.phpfreaks.com/topic/141964-solved-how-do-you-echo-multiple-results-displayed-one-below-the-other/#findComment-743339 Share on other sites More sharing options...
premiso Posted January 22, 2009 Share Posted January 22, 2009 Why use 4 echos when 1 would suffice? Just an improvement to that code: while ($row= mysql_fetch_array($result)) { { echo " This user has been located<br /> <b>Userid: </b>" . $row['field_1'] . "<br /> <b>fName: </b>" . $row['field_2']. "<br /> <b>lName: </b>" . $row['field_3'] . "<br />"; } Just felt like pointing that out. Have a good one. Quote Link to comment https://forums.phpfreaks.com/topic/141964-solved-how-do-you-echo-multiple-results-displayed-one-below-the-other/#findComment-743341 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.