I don't know the meanings of -> , ? , : in this line of code. Also can you please explain what $this means while you are at it?PHP Code:return ( $row = $db->sql_fetchrow($result) ) ? $row : false;
Thanks in advance
Printable View
I don't know the meanings of -> , ? , : in this line of code. Also can you please explain what $this means while you are at it?PHP Code:return ( $row = $db->sql_fetchrow($result) ) ? $row : false;
Thanks in advance
Its php's IIf decision structure function.
If there is a record returned from the resultset then reutn the row otherwise return False
the -> is used in classes to call a function.
$db is a class and sql_fetchrow() is a function.
$db->sql_fetchrow() calls the function.
In a non-static member of a class, $this points to the current instance of the class.
Return the value after comparison (?) of $row when $row, after execution of the member function (->) sql_fetchrow of the $db object instance, passing this function a copy of the data stored in $result; is a non null, non zero or a string containing 1 or more characters. Return false (: ) if it is zero, a zero length string or null.Quote:
Originally Posted by kill_bill_gates
always better when it is explained 4 times :)