How to insert a variable in $row[$var]

Custom / CUSTOM
February 10, 2010 at 10:47:01
Specs: Windows XP, 8g
Hi, wondering how to insert a variable into $row[' variable here']; I can't seem to
get it to work. Any help would be appriciated. A sample of my code is below.

--- CODE ---

$result = mysql_query("SELECT * FROM table
WHERE user='name'");

while($row = mysql_fetch_array($result))
$name = $row['user']
$firstname = $row['$name'];

--- END CODE ---

See More: How to insert a variable in $row[$var]

February 10, 2010 at 10:50:12
Found the solution, changed variable name to what it was meant
to be. Thanks anyway.

Report •
Related Solutions

Ask Question