php - Why does this version mysqli result work? -
the following code describes substitute mysql function mysql_result. since there none in mysqli, found code same exact thing, except user-created function. reason using function because need data different tables.
<?php function mysqli_result($res, $row, $field=0) { $res->data_seek($row); $datarow = $res->fetch_array(); return $datarow[$field]; } ?>
the arguments same mysql_result.br> after reading php functions, having problem understanding:
- what difference between
$field=0
,$field
- i think found similar on object oriented statements,
$res->data_seek($row);
set$res
equal data seek of$row
?$row
row one,$res
select row 1 of tables selected?
read default function parameters in manual. if caller not supply value third parameter (
$field
), set0
default.read oop basis in manual.
$res->data_seek($row);
calls method calleddata_seek
onres
object 1 parameter, objectrow
. depends ondata_seek()
whether supplied object (objects passed reference) modified.
Comments
Post a Comment