Are these both same?
$this->query($result, $connection);
return $result;
and,
return $this->query($result, $connection);
First code works fine, but, when I am running last code, I am getting error.
Is it possible?
I think both are same…
Isn’t it?
Someone please…
salathe
November 30, 2010, 7:44am
2
No, they aren’t the same.
The first code calls the query
method, then returns the $result
variable. The second code calls the query
method, then returns whatever the return value of that method was.
system
November 30, 2010, 7:45am
3
they’re not even close to the same.
the second returns the output of whatever the query method does.
the first returns whatever $result is - a variable or a resource.
Thanks to all of you.
This was my silly mistake.
Yes, You all are right.