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

(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.
Reply


Messages In This Thread
RE: What is better when return false - by Paradinight - 06-29-2017, 08:15 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