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

Mail form doesn't send Russian/Cyrillic characters correctly?
When someone enters foreign characters (like Cyrillic text, and Japanese/Chinese probably gives the

Help with explandable category tree
I have the below query:

SELECT l1.id as lev1_id,l2.id as lev2_id,l3.id as lev3_id,l1.categ

How to implement HTTP connection timeout
Hi All,I would like to implement an HTTP connection timeout.

I am working on a application wh

Query failed issue with php script but works fine in mssql manager!
hi i have the script below which copies data from one table to another but will only insert new data

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

How can I uploading Transactional Data from Legacy to New SAP system
Hell Gurus,

I am overwhelmed with questions on how to migrate huge volume of Sales Orders

PEAR in appliactiond development
When I was picking up PHP I went from procedural programming, fairly quickly into OOP, then after wr

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?

I was thinking s

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