How to use mysql_fetch_array in PHP : Tech Guru India How to use mysql_fetch_array in PHP :: Tech Guru India

How to use mysql_fetch_array in PHP




It is generally used to store values which we retrieve from mysql database table. As the name suggest it will convert "Resultset" in to array.

syntax:

$var = mysql_fetch_array($resultset)

Here, $resultset is the variable which we use to execute select query.
For example,

$resultset = mysql_query("SELECT * FROM employee) or die(mysql_error());

Then use,

while($row = mysql_fetch_array( $resultset ))
{
Print $row['empid']. " : ".$row['empname'];
}

It will auto-increment rows of resultset.



php fetch array
php mysqli fetch array
php fetch
php insert into array
php file array
php query array
php variables array
php function array
php variable array
php for loop array
php select array
php global variables
php if statement
php insert into
php freaks
php fread
php result array
php array sort
php fetcharray
script array
mysqli fetch array
form array
file array
fetch upload


We will send you more information, Enter your email address:


Related Posts with Thumbnails

Share/Save/Bookmark

0 comments:

Post a Comment