echo $rows help


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

Hi all,

Hopefully something simple that I don't know!

Did you know?Explore Trending and Topic pages for more stories like this.
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

Weird problem with SELECT command..Help!
Hi!

It seems I'm having a really weird problem with SQL SELECT command....I have table into a

Show specific day of the week
I have been racking my brain trying to get this function to work properly and it is doing so for eve

* Gridview and Detailsview in UpdatePanel, insert mode problem
I have a GridView and DetailsView working together. When a record from Gridview is selected, Detail

this code is strange !
Hi i got this code from the web.. It checks for live and dead socks
It is working perfectly on my

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

How to grab certain words ??
I am working with this API

Returns JSON.
curl http://letsbetrends.com/api/current_trends

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

Creation of Raw Exposure manually
SAP Gurus

I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

TinyMCE / Ajax Postback Problem
Hiya all,

I have a page which loads the TinyMCE editor. On the postback I obviously want to 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