downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

msql_fetch_field> <msql_error
[edit] Last updated: Fri, 24 Jun 2011

view this page in

msql_fetch_array

(PHP 4, PHP 5)

msql_fetch_arrayدریافت ردیف به عنوان آرایه

Description

array msql_fetch_array ( resource $result [, int $result_type ] )

msql_fetch_array() نسخه گسترش یافته msql_fetch_row() را دریافت می‌کند. علاوه بر ذخیره داده با اندیس‌های عددی در آرایه نتیجه داده را با توجه به نام فیلدها به عنوان کلید ذخیره می‌کند.

نکته مهم این است که استفاده msql_fetch_array() کندتر از msql_fetch_row() نیست در حالی که یک مقدار مهم اضافه‌تر باز می‌گرداند.

Parameters

result

The result resource that is being evaluated. This result comes from a call to msql_query().

result_type

قثابت مقادیر زیر را می‌تواند داشته باشد: MSQL_ASSOC, MSQL_NUM، و MSQL_BOTH با MSQL_BOTH به عنوان پیش‌فرض.

Return Values

بازگرداندن آرایه متناسب با ردیف دریافت شده یا FALSE در صورت شکست.

Examples

Example #1 مثال msql_fetch_array()

<?php
$con 
msql_connect();
if (!
$con) {
    die(
'Server connection problem: ' msql_error());
}

if (!
msql_select_db('test'$con)) {
    die(
'Database connection problem: ' msql_error());
}

$result msql_query('SELECT id, name FROM people'$con);
if (!
$result) {
    die(
'Query execution problem: ' msql_error());
}

while (
$row msql_fetch_array($resultMSQL_ASSOC)) {
    echo 
$row['id'] . ': ' $row['name'] . "\n";
}

msql_free_result($result);
?>

Changelog

Version Description
4.3.11 and 5.0.4 باگی در مورد دریافت داده از ستون‌های شامل NULL حل شد. این ستون‌ها در آرایه نتیجه نیستند.

See Also



add a note add a note User Contributed Notes msql_fetch_array - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites