note 129786 added to mysqli-stmt.bind-param

From: Date: Mon, 30 Sep 2024 12:29:44 +0000
Subject: note 129786 added to mysqli-stmt.bind-param
Groups: php.notes 
Request: Send a blank email to php-notes+get-221571@lists.php.net to get a copy of this message
I just thought I'd add this as I just wasted ages trying to deal with a simple query; AND linkid='?' Yet PHP was still telling me; "Warning: mysqli_stmt_bind_param(): Number of variables doesn't match number of parameters". Even though I'd given it the one variable it was expecting it still refused to accept it and kept giving that error - #ragemode Turns out the solution in my case was that I'd wrapped the ? in the sql in single quotes..... if you do this you'll get the above error even though everything looks ok. Beginners error - or I need more coffee ;) ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 164.39.4.174) ---- Manual Page -- https://php.net/manual/en/mysqli-stmt.bind-param.php Edit -- https://main.php.net/note/edit/129786 Del: integrated -- https://main.php.net/note/delete/129786/integrated Del: useless -- https://main.php.net/note/delete/129786/useless Del: bad code -- https://main.php.net/note/delete/129786/bad+code Del: spam -- https://main.php.net/note/delete/129786/spam Del: non-english -- https://main.php.net/note/delete/129786/non-english Del: in docs -- https://main.php.net/note/delete/129786/in+docs Del: other reasons-- https://main.php.net/note/delete/129786 Reject -- https://main.php.net/note/reject/129786 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221571) next »