Re: Couldn't get all data using the "mysql_fetch_array" function, Pls Help!!!!

From: Date: Wed, 29 Aug 2001 15:30:42 +0000
Subject: Re: Couldn't get all data using the "mysql_fetch_array" function, Pls Help!!!!
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11956@lists.php.net to get a copy of this message
while ($row= mysql_fetch_array($result,MYSQL_ASSOC)) { foreach ($row as $value){ print ("$value |"); } } ----- Original Message ----- From: "Jack" <jack@nedcor.com> To: <php-db@lists.php.net> Sent: Wednesday, August 29, 2001 6:16 PM Subject: [PHP-DB] Couldn't get all data using the "mysql_fetch_array" function, Pls Help!!!! > Dear all > I was trying to fetch all the data from one of my table "leaverequest", but > i couldn't fetch all the data if i use the * . > here is my program, this one is only fetch the Reason field, but what i want > is all the data. > > <? > $dblink=mysql_pconnect("microsoft","console","edshk"); > mysql_select_db("nedcorhk",$dblink); > $query = "select * from leaverequest"; > $result=mysql_query($query,$dblink); > > while ($row= mysql_fetch_array($result,MYSQL_ASSOC)) > { > print ("{$row["Reason"]}"); > } > ?> > > But can i do it like that way to get all the data? (Showing below) : > > <? > $dblink=mysql_pconnect("microsoft","console","edshk"); > mysql_select_db("nedcorhk",$dblink); > $query = "select * from leaverequest"; > $result=mysql_query($query,$dblink); > > while ($row= mysql_fetch_array($result,MYSQL_ASSOC)) > { > print ("{$row["*"]}"); > } > ?> > > > Pls help me!! > > Thx > jack > jack@nedcor.com > jackps1@speed-link.com.hk > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#11956) next »