how did this become an array?

From: Date: Tue, 02 Apr 2002 14:10:06 +0000
Subject: how did this become an array?
Groups: php.general 
Request: Send a blank email to php-general+get-91128@lists.php.net to get a copy of this message
Hi, I am trying to figure out a part of the PHP code which belongs to one of the files that is responsible for operating a discussion group. I was examining some of a part of the code which produces the total number of messages and displays the subject of the message. I encountered a part that looks like this: mysql_select_db("discussionboard", $db) or die("Couldnot select database"); $sql = "select max(thread) as thread, max(mesgid) as mesgid from discussionboard"; $result = mysql_query($sql) or die("Query failed"); $numrows = mysql_num_rows($result); $result_row = mysql_fetch_row($result); echo"<center><b>No of topics: $result_row[0]<br> No of total messages: $result_row[1]</b> What I don't understand is how did $result_row become $result_row[0] and $result_row[1]? Also what does it mean to select max(thread) as thread, max(mesid) as mesgid? I have never used this "as" command before. Thanks for any insight. Peter

« previous php.general (#91128) next »