php - Can't execute PDO query (Invalid parameter number) but it is not invalid -


i have in same class 3 functions , functions consists db queries. in other functions queries ok, in this:

$userid = $_session['uid'];          $st = $this->db->prepare("select * showinfo, usershows usershows.showid = showinfo.showid , usershows.userid = :userid");         $st->bindparam('userid', $userid);         $st-> execute(); 

but here query doesn't work:

$st = $this->db->prepare("delete usershows usershows.userid = :userid");             $st->bindparam(':userid', $userid);             $st->execute(); 

it says:

warning: pdostatement::execute(): sqlstate[hy093]: invalid parameter number: parameter not defined in (file location)

and code can echo out userid, can not empty.

any suggestions?

in second examples bindparam() need use :userid , not :userid

php case sensitive!


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -