Calling all values of variables into one variable
| From: | Rahul.Brenda | Date: | Tue, 11 Mar 2003 07:20:21 +0000 |
| Subject: | Calling all values of variables into one variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139097@lists.php.net to get a copy of this message | ||
What the following script does is that it gives a
result of 4 rows, from the database, and generates 4
variables (newsbits0, newsbits1, newsbits2,
newsbits3), and inserts result data into each of these
variables.
What i want is a final 5th variable which contains all
the data of the first 4 variables.. so that i can call
that variable in my Flash file and display the result
in one Dynamic Text field..
<?php
$db = mysql_connect("localhost","user","pass");
mysql_select_db("myDB",$db);
$result = mysql_query("SELECT substring_index(title,'
', 6) FROM news ORDER BY ID desc limit 4",$db);
if (!mysql_num_rows($result)) {
print 'no results';
} else {
$count = 0;
while (list($title) = mysql_fetch_row($result)) {
print "&newsbits$count=$title";
++$count;
}
}
?>
Rahul S. Johari
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com