I am new in php and i am facing a problem in mysqli query Parse error: syntax error, unexpected ',' in php
can anyone help me if you know?



$query=("update company SET","(freeze_reason='.$pid.',freeze_status=1 where cid=:id"),array('id'=>$cid));
                return self::query($query,$str,$params);


 public static function query($query,$param_string="",$param_array=array()){//used in void type query like insert,delete,update
        $stmt=self::$mysqli->prepare($query);
        array_unshift($param_array,$param_string);
        if(count($param_array)>1)
            call_user_func_array(array($stmt,'bind_param'),$param_array);
        $stmt->execute();
        $ans=max(self::$mysqli->affected_rows,self::$mysqli->insert_id);
        $stmt->close();
        return $ans;

what is the complete error message, what you have provided has been edited: useless

Member Avatar for diafol

Have a think about what you're actually asking for and read this: http://bit.ly/Dwebphp

On line 6 replace "," with a space after SET.

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.