hi singh well, The mysql_fetch_row() function returns a row from a recordset as a numeric array.
This function gets a row from the mysql_query() function and returns an array on success, or FALSE on failure or when there are no more rows.
Syntax :---
mysql_fetch_row(data)
b ool make_record_from_result_set( MYSQL_RES *results, record *osi_record )
{
MYSQL_ROW row;
...
unsigned long *lengths;
if( ( results == NULL ) || ( osi_record == NULL ) )
{
return FALSE;
}
/* verify we have results. */
if( ( row = mysql_fetch_row( results ) ) == NULL )
{
return FALSE;
}
Example
<?php
$ con = mysql_connect("localhost", "peter", "abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_sele cted = mysql_select_db("test_db",$con );
$sql = "SELECT * from Person WHERE Lastname='Refsnes'";
$result = mysql_query($sql,$con);
print _r(mysql_fetch_row($result));
mysql_close($con);
?>
Answered by: Saurabh at 8:23 AM on May 16, 2008 | Saurabh's Q&A | Report Abuse
Rate this : 00
Well,
Dear
Definitio n and Usage
The mysql_fetch_row() function returns a row from a recordset as a numeric array.
This function gets a row from the mysql_query() function and returns an array on success, or FALSE on failure or when there are no more rows.
Syntax :---
mysql_fetch_row(data)
Tips and Notes
Note: After the data is retrieved, this function moves to the next row in the recordset. Each subsequent call to mysql_fetch_assoc() returns the next row in the recordset.
Example
<?php
$con = mysql_connect("localhost", "peter", "abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_sele cted = mysql_select_db("test_db",$con );
$sql = "SELECT * from Person WHERE Lastname='Refsnes'";
$result = mysql_query($sql,$con);
print _r(mysql_fetch_row($result));
mysql_close($con);
?>
Answered by
laks
, an ibibo Master,
at
3:28 PM on May 21, 2008