note 124425 added to function.mysql-result
| From: | bob dot schuon at loungelizard dot com | Date: | Fri, 22 Nov 2019 17:32:27 +0000 |
| Subject: | note 124425 added to function.mysql-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213163@lists.php.net to get a copy of this message | ||
This function accounts for the ability of the original function to accept
"table_name.field_name" entries as well as just the field name:
function mysqli_result($res, $row, $field=0) {
$result->data_seek($row);
$data = $result->fetch_array();
$field_name = $field;
if ( is_string($field) ) {
$fields_array = explode(".", $field);
$array_len = count($fields_array);
if ($array_len > 1) {
$field_name = $fields_array[array_len - 1];
} else {
$field_name = $fields_array[0];
}
}
return $data[$field_name];
}
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.54 (proxied: 173.220.38.42)
----
Manual Page -- http://php.net/manual/en/function.mysql-result.php
Edit -- https://master.php.net/note/edit/124425
Del: integrated -- https://master.php.net/note/delete/124425/integrated
Del: useless -- https://master.php.net/note/delete/124425/useless
Del: bad code -- https://master.php.net/note/delete/124425/bad+code
Del: spam -- https://master.php.net/note/delete/124425/spam
Del: non-english -- https://master.php.net/note/delete/124425/non-english
Del: in docs -- https://master.php.net/note/delete/124425/in+docs
Del: other reasons-- https://master.php.net/note/delete/124425
Reject -- https://master.php.net/note/reject/124425
Search -- https://master.php.net/manage/user-notes.php