mysql_result

(PHP 4, PHP 5)

mysql_result取锟矫斤拷锟斤拷锟斤拷锟�

说锟斤拷

mysql_result ( resource $result , int $row [, mixed $field ] ) : mixed

mysql_result() 锟斤拷锟斤拷 MySQL 锟斤拷锟斤拷锟斤拷锟揭伙拷锟斤拷锟皆拷锟斤拷锟斤拷荨锟斤拷侄尾锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷侄蔚锟狡拷锟斤拷锟斤拷锟斤拷锟斤拷侄锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷侄伪锟斤拷锟街讹拷锟斤拷锟斤拷tablename.fieldname锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷吮锟斤拷锟斤拷锟�'select foo as bar from...'锟斤拷锟斤拷锟斤拷锟矫憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�

锟斤拷锟斤拷锟斤拷锟节很达拷慕锟斤拷锟斤拷时锟斤拷应锟矫匡拷锟斤拷使锟斤拷锟杰癸拷取锟斤拷锟斤拷锟叫的猴拷锟斤拷锟斤拷锟斤拷锟铰憋拷指锟斤拷锟斤拷锟斤拷锟斤拷些锟斤拷锟斤拷锟斤拷一锟轿猴拷锟斤拷锟斤拷锟斤拷锟叫凤拷锟斤拷锟剿讹拷锟斤拷锟皆拷锟斤拷锟斤拷荩锟斤拷锟� mysql_result() 锟斤拷枚唷o拷锟斤拷锟阶拷锟斤拷锟斤拷侄尾锟斤拷锟斤拷锟街革拷锟斤拷锟斤拷锟狡拷锟斤拷锟斤拷锟街革拷锟斤拷侄锟斤拷锟斤拷锟斤拷锟� tablename.fieldname 要锟斤拷枚唷�

锟斤拷锟斤拷 mysql_result() 锟斤拷锟杰猴拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥猴拷锟斤拷锟斤拷系锟斤拷谩锟�

Example #1 mysql_result() 锟斤拷锟斤拷

<?php
    $link 
mysql_connect("localhost""mysql_user""mysql_password")
            or die(
"Could not connect: " mysql_error());

    
$result mysql_query("SELECT name FROM work.employee")
            or die(
"Could not query: . mysql_error());

    echo mysql_result(
$result,2); // outputs third employee's name

    mysql_close(
$link);
?>

锟狡硷拷使锟矫革拷锟斤拷锟杰碉拷锟斤拷锟斤拷锟斤拷锟斤拷锟�mysql_fetch_row()锟斤拷mysql_fetch_array()锟斤拷mysql_fetch_assoc() 锟斤拷 mysql_fetch_object()锟斤拷