Page 1 of 1
Print
Posted: Sat Mar 22, 2008 3:56 am
by Wackie
Hi.
I want to ask you, how to make a new printname for each print.
Code: Select all
print("&variablename1=$variable2");
So that my first print would be &variablename1,
second print &variablename2,
third print &variablename3, and so on.
Hope you can help me.
Re: Print
Posted: Sat Mar 22, 2008 4:30 am
by onion2k
We'll need a bit more information about what you want to do. You either want a for..next loop, or an incrementing variable.
Also, you probably ought to use echo rather than print. Print is used if you need to check the return value ... as you're not checking it echo is more appropriate.
Re: Print
Posted: Sat Mar 22, 2008 5:18 am
by Wackie
Ok, what I want to do, is to get my data from mysql and load it via flash.
But for flash to load more data, I need the Echo variable to have different names.
Here is my script and I've changed the print to echo:
Code: Select all
<?php
$hostname = "localhost";
$username = "root";
$password = "********";
$usertable = "Table";
$dbName = "Database";
mysql_pconnect($hostname, $username, $password) OR DIE("DB connection unavailable");
@mysql_select_db("$dbName") or die( "Unable to select database");
$query = mysql_query("SELECT * FROM `$usertable`");
while ($row = @mysql_fetch_array($query))
{
$variable2=$row["variablename"];
echo("&variablename=$variable2");
}
?>
Re: Print
Posted: Sat Mar 22, 2008 5:50 am
by Frank Shi
$variable2[]=$row["variablename"];
Re: Print
Posted: Sat Mar 22, 2008 8:45 am
by Wackie
I found another way of making my script, but thanks anyway Frank Shi.

Re: Print
Posted: Mon Jun 02, 2008 9:20 pm
by Frank Shi