i wrote a query... it must return false instead its returning false..i cant find why

public static function find_cart_id($cid){
    $query="SELECT customer_id FROM tblshopping_cart WHERE customer_id='$cid'";

    if(mysql_query($query))
        {
            return true;
        }
        else
        {
            return false;   
        }           
}

even if i use some text instead of $cid it still returns true :( . this function worked before i changed my code though... Please can anyone help me?

Recommended Answers

All 2 Replies

Ooooooooooooppss soo sorry... i got this so wrong hehe...
now i used
$result=mysql_query($query); and
$num1=mysql_numrows($result);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.