فنکشن mysql_fetch_row() PHP
تعریف و استفاده
فنکشن mysql_fetch_row() یک ردیف از مجموعه نتایج را به عنوان یک آرایه عددی دریافت میکند.
Syntax
mysql_fetch_row(data)
Parameters | Description |
---|---|
data | Required. The data pointer to use. This data pointer is returned from mysql_query(). |
Description
mysql_fetch_row() from the result identifier data Retrieve a row of data from an associated result set and return it as an array. Each column of the result is stored in an element of the array, starting from 0.
Sequential calls to mysql_fetch_row() will return the next row in the result set, or FALSE if there are no more rows.
Return Value
Returns an array generated based on the retrieved row, or FALSE if there are no more rows.
Example
<?php $con = mysql_connect(\ if (!$con) { die('Could not connect: ' . mysql_error()); $db_selected = mysql_select_db(\ $sql = \ $result = mysql_query($sql,$con); print_r(mysql_fetch_row($result)); mysql_close($con); ?>
Output:
Array ( [0] => Adams [1] => John [2] => London )