public function qdelete(){
$tbl = self::prepArgs(4, func_get_args());
$this->db->delete('Storage_Users');
if($this->db->affected_rows() > 0){
return TRUE;
}else{
$this->msg = 'There was an issue removing that record.<br />' . $this->db->_error_message();
return FALSE;
}
}
public function qdelete(){ $tbl = self::prepArgs(4, func_get_args()); $this->db->delete('Storage_Users'); if($this->db->affected_rows() > 0){ return TRUE; }else{ $this->msg = 'There was an issue removing that record.<br />' . $this->db->_error_message(); return FALSE; } }
ifIf you write it like this
if($valid){
$this->db->update($tname, $data);
$a = ($this->db->affected_rows() > 0);
if(!$a){
$this->$msg .= $this->db->_error_message();
return FALSE;
}else{
return TRUE;
}
}else{
return $valid;
}
if($valid){ $this->db->update($tname, $data); $a = ($this->db->affected_rows() > 0); if(!$a){ $this->$msg .= $this->db->_error_message(); return FALSE; }else{ return TRUE; } }else{ return $valid; }
whenWhen you enter the outside if statement, it's valid then you have the nested if statement. if !$a
then it will return a message otherwise it is true. you could just write it like this
itIt really looks to me like you need to break these if statements into separate functions, that function is just too big and ugly looking.
I noticed that you use them over and over again. it kind of looks like you weren't sure how to structure the functions. like whether to put action stuff together or the components together. you can actually put the components together first, in a function, and then create the functions the way you have them with the other functions being called inside of them. it will make all of them look a lot cleaner, and probably reduce some of the code.
That is all the farther that I got so far.
public function qdelete(){
$tbl = self::prepArgs(4, func_get_args());
$this->db->delete('Storage_Users');
if($this->db->affected_rows() > 0){
return TRUE;
}else{
$this->msg = 'There was an issue removing that record.<br />' . $this->db->_error_message();
return FALSE;
}
}
if you write it like this
if($valid){
$this->db->update($tname, $data);
$a = ($this->db->affected_rows() > 0);
if(!$a){
$this->$msg .= $this->db->_error_message();
return FALSE;
}else{
return TRUE;
}
}else{
return $valid;
}
when you enter the outside if statement, it's valid then you have the nested if statement. if !$a
then it will return a message otherwise it is true. you could just write it like this
it really looks to me like you need to break these if statements into separate functions, that function is just too big and ugly looking.
I noticed that you use them over and over again. it kind of looks like you weren't sure how to structure the functions. like whether to put action stuff together or the components together. you can actually put the components together first, in a function, and then create the functions the way you have them with the other functions being called inside of them. it will make all of them look a lot cleaner, and probably reduce some of the code.
That is all the farther that I got so far.
public function qdelete(){ $tbl = self::prepArgs(4, func_get_args()); $this->db->delete('Storage_Users'); if($this->db->affected_rows() > 0){ return TRUE; }else{ $this->msg = 'There was an issue removing that record.<br />' . $this->db->_error_message(); return FALSE; } }
If you write it like this
if($valid){ $this->db->update($tname, $data); $a = ($this->db->affected_rows() > 0); if(!$a){ $this->$msg .= $this->db->_error_message(); return FALSE; }else{ return TRUE; } }else{ return $valid; }
When you enter the outside if statement, it's valid then you have the nested if statement. if !$a
then it will return a message otherwise it is true. you could just write it like this
It really looks to me like you need to break these if statements into separate functions, that function is just too big and ugly looking.
I noticed that you use them over and over again. it kind of looks like you weren't sure how to structure the functions. like whether to put action stuff together or the components together. you can actually put the components together first, in a function, and then create the functions the way you have them with the other functions being called inside of them. it will make all of them look a lot cleaner, and probably reduce some of the code.
talking about the if then
statements in the functions
I noticed that you use them over and over again. it kind of looks like you weren't sure how to structure the functions. like whether to put action stuff together or the components together. you can actually put the components together first, in a function, and then create the functions the way you have them with the other functions being called inside of them. it will make all of them look a lot cleaner, and probably reduce some of the code.
That is all the farther that I got so far.
That is all the farther that I got so far.
talking about the if then
statements in the functions
I noticed that you use them over and over again. it kind of looks like you weren't sure how to structure the functions. like whether to put action stuff together or the components together. you can actually put the components together first, in a function, and then create the functions the way you have them with the other functions being called inside of them. it will make all of them look a lot cleaner, and probably reduce some of the code.
That is all the farther that I got so far.