Welcome Guest, Not a member yet? Register   Sign In
What is better when return false
#3

(06-29-2017, 08:15 PM)Paradinight Wrote:
(06-29-2017, 07:42 PM)wolfgang1983 Wrote: Hello when using return false I would also like to know if return "" is OK 

Or which one is better over the other.

PHP Code:
public function getattachments($where_column ''$id '')
{
 if (
$id) {
 
   $this->db->where($where_column$id);
 } 

 
$query $this->db->get($this->db->dbprefix $this->table_name);

 if (
$query->num_rows() > 0) {
 
  return $query->result_array();
 }

 return 
"";
 


Return an empty array.

Something like return array();
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: What is better when return false - by wolfgang1983 - 06-29-2017, 09:17 PM
RE: What is better when return false - by rtenny - 06-30-2017, 07:08 AM
RE: What is better when return false - by SomeGuy - 04-06-2018, 12:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB