#22469 [Opn->Bgs]: alias for mysql_result($res, 0)

From: Date: Sat, 23 Aug 2003 16:51:29 +0000
Subject: #22469 [Opn->Bgs]: alias for mysql_result($res, 0)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46526@lists.php.net to get a copy of this message
ID: 22469 Updated by: andrey@php.net Reported By: Amiel dot Martin at wwu dot edu -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.2.3 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. You may use array_pop to achieve this : <? $res = mysql_query("SELECT col_one, col_two FROM table") or die("blah"); while( $feild = array_pop(mysql_fetch_row($res)) ) echo "$feild\n"; ?> Previous Comments: ------------------------------------------------------------------------ [2003-02-27 23:26:03] Amiel dot Martin at wwu dot edu I use: $res = mysql_query("SELECT one_column FROM table") or die("blah"); $var = mysql_result($res,0); VERY often. I am requesting a pop-like function for a mysql result; so that: mysql> SELECT col_one, col_two FROM table; --------------------- | col_one | col_two | |---------|---------| | res one | res two | | res thr | res fou | |-------------------| <? $res = mysql_query("SELECT col_one, col_two FROM table") or die("blah"); while( $feild = mysql_pop($res) ) echo "$feild\n"; ?> would print: res one res two res thr res fou thanks much, Amiel ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22469&edit=1

« previous php.bugs (#46526) next »