Welcome Guest, Not a member yet? Register   Sign In
[Help] why cant access NULL value
#1

[eluser]C_Line[/eluser]
i have a code like this
Code:
$id_sups = $this->db->query("Select id_supplier from supplier where
                            nama_supplier ='$finals[6]'")->result();
$id_supss = $this->db->query("Select id_supplier from supplier where
                             nama_supplier ='$finals[6]'");
if($id_supss->num_rows() < 0){
$jum = $this->db->query("select max(id_supplier) from supplier");
foreach($jum->result_array() as $cnt){
foreach($cnt as $key=>$value){
$nil = $value;
$id_supplier = $nil + 1;
}}
}else{
foreach($id_sups as $vals){
$id_supplier = $vals->id_supplier;
}}

but it can't access if dont have a row , if($id_supss->num_rows() < 0) <-- this code
but it can access when it have a row

help me, thx


Messages In This Thread
[Help] why cant access NULL value - by El Forum - 07-12-2012, 05:24 AM
[Help] why cant access NULL value - by El Forum - 07-12-2012, 05:31 AM
[Help] why cant access NULL value - by El Forum - 07-12-2012, 05:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB