Jump to content

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


carley_bell

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.