Welcome Guest, Not a member yet? Register   Sign In
hhmm got big problem with NULL
#1

[eluser]KrizzAngel[/eluser]
i have this test code for my DB..
Quote:$this->db->query("select * from tblprof where name='".$this->input->post('name')."' AND section IS NULL");
$num = $this->db->count_all_results();
if($num==1){ echo "meron"; }
else {
echo "wala";
}

im always getting "meron" i dont know why.. i already inserted some values on section field of my DB still im getting "meron".. is my constraint correct??
#2

[eluser]Armchair Samurai[/eluser]
count_all_results() is used for AR queries, not standard DB queries. Try using num_rows().
#3

[eluser]KrizzAngel[/eluser]
oh tnx.. it worked now




Theme © iAndrew 2016 - Forum software by © MyBB