Page 1 of 1

sort of an SQL question

Posted: Fri Jan 30, 2004 10:38 pm
by Illusionist
ok, i've got a database and table setup... the table has columns, when i try to get the result fromt he columns i try and use $myrow['name']; but it never works, i always have to use $myrow[1]; does anyone know why i can't use the column name?

Code: Select all

while ($myrow = mysql_fetch_row($result)) {
	echo "<tr><td>";
	echo $myrow[1];
	echo "</td><td>";
	echo $myrow[2];
	echo "</td>";
}
echo "</table>\n";

Posted: Fri Jan 30, 2004 11:07 pm
by McGruff
Check these out:

[php_man]mysal_fetch_assoc[/php_man]

[php_man]mysql_fetch_array[/php_man]

Posted: Sat Jan 31, 2004 9:43 am
by Illusionist
ahha! Thanks! Got it to work with mysql_fetch_array!