Jump to content

[SOLVED] how do you echo multiple results displayed one below the other?


Recommended Posts

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

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 />";
         
      }

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.