acquiring value from a sql statement which contains an alias

From: Date: Tue, 21 Oct 2003 04:42:19 +0000
Subject: acquiring value from a sql statement which contains an alias
Groups: php.db 
Request: Send a blank email to php-db+get-31214@lists.php.net to get a copy of this message
I have a question, I have this SQL statement, $sql_stmt = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM visitdate) AS availYearMonth FROM visitedurl;"; $result = mysql_query ($sql_stmt); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo $row["availYearMonth"]; } By right the value that I should be getting is "200310" via the Mysql command line client. But with PHP all I got was the value of "1". Would appreciate if anyone can nudge me in the right directory. Thanks in advance and would appreciate it.

« previous php.db (#31214) next »