Welcome Guest, Not a member yet? Register   Sign In
simple_query() return...?
#1

[eluser]rvent[/eluser]
Hello,

I have this controller that takes the data from the user and inserts it into the DB. But i want to make sure that there is not other record like it so i have the following

Controller:
Code:
function testDB()
    {
        $this->load->model('Boards/SmtJob');
        
        $newPart = "TES-TEST2";
        $res = $this->SmtJob->isPart($newPart);
        echo "$newPart";
        echo "$res";
    }

Model:
Code:
function isPart($part)
    {
        echo "part is $part";
        $bool = $this->db->simple_query("SELECT PartNumber FROM PartNumber WHERE PartNumber = '$part'");
        return $bool;
    }

the $bool is being returned to the controller, but when i echo it to see what it is i get: "Resource id #46"

Isnt it supposed to return TRUE or FALSE...?

Thanks


Messages In This Thread
simple_query() return...? - by El Forum - 05-01-2008, 08:18 AM
simple_query() return...? - by El Forum - 05-01-2008, 08:23 AM
simple_query() return...? - by El Forum - 05-01-2008, 10:22 AM
simple_query() return...? - by El Forum - 05-01-2008, 10:55 AM
simple_query() return...? - by El Forum - 05-01-2008, 11:37 AM
simple_query() return...? - by El Forum - 05-01-2008, 12:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB