echo $rows help


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Select]<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 "&nbsp;";
echo "<span style='color:#0F0'>Todays Price = $t_val</span>";
echo "&nbsp;";
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

No comments posted yet

Your Answer:

Login to answer
129 Like 28 Dislike
Previous forums Next forums
Other forums

PHP & Images [Resize, Crop, Save]
Hey! Well I have a little dilema, hoping I could find some guidance.

I have a CMS and on the

session checking in page load
hai all I have a web site is www.Mryas.com in this my login page is Page1.aspx its co

Empty text file when there is over XXXX lines of text.

define("RANDOM_FILE","/public_html/random.txt");
$randomEntry = "

Email to a friend script problems
I have this send-to-a-friend script with 2 issues:


1) When you open the form popup on a p

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Converting from one format to another
"I have got a date in DD/MM/YYYY but I need it in MM-DD-YYYY. Help!"

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and n

Expandable Post Code
Hi,

Hope you can help. Which currently I haven't upgraded to connect to a mysql server, so i

Help with captcha script needed
Hello,

I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash