Re: Why doesn't my short piece of code work??? :(

From: Date: Thu, 07 Dec 2000 19:04:36 +0000
Subject: Re: Why doesn't my short piece of code work??? :(
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-29191@lists.php.net to get a copy of this message
I guess echo mysql_result($result, $i, $column) mysql_result($result, $i, "numbers") "; should be echo mysql_result($result, $i, $column); (missing semi colon) mysql_result($result, $i, "numbers") "; Sandeep Hundal wrote: > Hi all, I've got this short stripped down basic code to get some > results from a table, but I can't get it to work. Any ideas why?? > > $column = "country"; > > $result = mysql_query("SELECT $column, count(*) AS numbers FROM > $tablename GROUP BY $column"); > > for($i =0; $i < mysql_num_rows($result); $i++) { > > echo mysql_result($result, $i, $column) mysql_result($result, $i, > "numbers") "; > echo "<br>"; > > } > echo "<font color=red>".mysql_error()."</font>"; > > mysql_free_result($result); > > TIA!!! > > Sandeep Hundal > > __________________________________________________ > Do You Yahoo!? > Yahoo! Shopping - Thousands of Stores. Millions of Products. > http://shopping.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#29191) next »