Could get all data from MYSQL using Mysql_fetch_array!!
| From: | Jack | Date: | Wed, 29 Aug 2001 15:13:21 +0000 |
| Subject: | Could get all data from MYSQL using Mysql_fetch_array!! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11953@lists.php.net to get a copy of this message | ||
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