Jump to content

echo $rows help


herghost

Recommended Posts

Hi all,

 

Hopefully something simple that I don't know!

 

I have this:

 

<div id="marquee">


<?php
$query = mysql_query("SELECT stock_id, stock_code, t_val, y_val FROM stocks");
while($rows=mysql_fetch_array($query))
{
$stock_code = $rows['stock_code'];
$t_val = $rows['t_val'];
$y_val = $rows['y_val'];
$stock_id = $rows['stock_id'];

echo "<marquee>";
echo "<span style='color:#09F'>$stock_code</span>";
echo " ";
echo "<span style='color:#0F0'>Todays Price = $t_val</span>";
echo " ";
echo "<span style='color:#F00'>Yesterdays Price = $y_val</span>";
echo "</marquee>";
}

?>

Which simply displays the output of a database in a scrolling marquee, which almost works! However the problem I have is that it displays like this:

 

ROW1

ROW2

 

How can I make it display like this:

 

ROW1 ROW2

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/178202-echo-rows-help/
Share on other sites

<div id="marquee">

<marquee>
<?php
$query = mysql_query("SELECT stock_id, stock_code, t_val, y_val FROM stocks");
while($rows=mysql_fetch_array($query))
{
$stock_code = $rows['stock_code'];
$t_val = $rows['t_val'];
$y_val = $rows['y_val'];
$stock_id = $rows['stock_id'];

   echo "<span style='color:#09F'>$stock_code</span>";
   echo " ";
   echo "<span style='color:#0F0'>Todays Price = $t_val</span>";
   echo " ";
   echo "<span style='color:#F00'>Yesterdays Price = $y_val</span>";
}

?>
</marquee>

Link to comment
https://forums.phpfreaks.com/topic/178202-echo-rows-help/#findComment-939547
Share on other sites

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.