
December 8th, 2012, 04:45 PM
|
 |
Contributing User
|
|
Join Date: Nov 2012
Posts: 98
Time spent in forums: 1 Day 2 h 20 m 38 sec
Reputation Power: 1
|
|
|
Define array with row = Mysql_fetch_array
Hi all,
It's been about 6 years since I've read a PHP book - so this may sound trivial to you all, but I'm fretting over this functionality:
I'm trying to simply output 3 mysql results to 3 variables that I can then use inside of a marquee html tag. The mysql query is set to LIMIT 3, to keep the result concise. Here is what I have, but I know it's not right !::!
PHP Code:
$queryMan = "SELECT DISTINCT(manufacturer) FROM manufacturer ORDER BY RAND() LIMIT 3";
$resultMan = @mysql_query($queryMan);
$i=0;
while ($rowMan = mysql_fetch_array($resultMan)) {
$man = Array();
$man[$i] = $rowMan[$i];
$i++;
}
?>
<h5><marquee behavior="scroll" direction="left">Text...<?php echo $man1.', '.$man2.', and '.$man3; ?>...more text</marquee></h5>
When i echo $man[$i] within the while loop to test it, I only get one row, while I needed three rows.
Can somebody serve me with the right info here...
|