devil_online wrote:
Hi, I want to print each element of a column of a mysql database. For exemple to print the first element could we do like this: Code:
$result = mysql_query( "SELECT username FROM users" ); $column = mysql_fetch_array($result); print $column[1]; print $column[3];
Thanks
You need to loop thru the result set if it's going to return more than one row....
while ( $column = mysql_fetch_array ( $result ) { print $column[0]; }
In your query above, there won't be a $column[1] [2], etc., since you're only selecting 'username'. 'username' will be the first and only element.
-- By-Tor.com It's all about the Rush http://www.by-tor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php