I understand how to use variable names in my array statements:
Code: Select all
<?php
.
.
.
$query = mysql_query("SELECT Name FROM Users WHERE ID=1");
while($Record=mysql_fetch_array($query))
{
echo "Username: ".$Recordї"Name"]."<br>";
}
.
.
.
?>Code: Select all
<?php
.
.
.
$query = mysql_query("SELECT Users.Name, Games.Name FROM Users INNER JOIN Games ON (Users.GameID = Games.ID) WHERE Users.ID=1");
while($Record=mysql_fetch_array($query))
{
// Here is the question. $Recordї"Users.Name"] won't work.
// $Recordї"Name"] won't work because there are 2 of them in the record set.
// I could just use $Recordї0] and $Recordї1], but it's kind of sloppy and error prone if I change the SQL statement.
// How do I acces these by name with this kind of query?
}
.
.
.
?>Code: Select all
echo "This users name is ".$Recordї"Name"]."...";Code: Select all
echo "This users name is $Recordї"Name"]...";Code: Select all
echo "This users name is $Recordї'Name']...";