ID:               22469
 Updated by:       [EMAIL PROTECTED]
 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

Reply via email to