MySQL Invalid Parameter Error
On Login to WebGui following error occurs:
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /var/www/htdocs/system/database/mysql.php on line 46
After reload I can use the gui without problems.
Version is Masterbranch
Comments (6)
-
repo owner -
reporter Hi Janos, the problem is only a warning, so no PDOExpeption is throwing. I add print_r to see the query and the array.
Here is the output:
SELECT u.username, u.uid, u.realname, u.dn, u.password, u.isadmin, u.domain FROM user u, email e WHERE e.email=? AND e.uid=u.uid Array ( [0] => user1@mydomain.com ) INSERT INTO audit (ts, email, domain, action, ipaddr, meta_id, description) VALUES(?,?,?,?,?,?,?) Array ( [0] => 1409122488 [1] => user1@mydomain.com [2] => mydomain.com [3] => 2 [4] => 123.231.214.25 [5] => [6] => successful auth against user table ) SELECT domain FROM domain_user WHERE uid=?Array ( [0] => 1 ) SELECT gid FROM email_groups WHERE uid=?Array ( [0] => 1 ) SELECT email FROM email WHERE uid IN (1) Array ( ) Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /var/www/piler.mydomain.com/system/database/mysql.php on line 46 SELECT g.email FROM
group_email
g WHERE g.id IN (SELECT u.id FROMgroup_user
u WHERE u.email IN (?))Array ( [0] => user1@mydomain.com [1] => user5@mydomain.com [2] => user3@mydomain.com [3] => user4@mydomain.com [4] => user1@mydomain.com [5] => praxis@mydomain.com [6] => user2@mydomain.com [7] => user3@mydomain.com ) SELECT id FROMfolder_user
WHERE uid=?Array ( [0] => 1 ) SELECT id FROMfolder_extra
WHERE uid=?Array ( [0] => 1 ) SELECT ga_enabled FROM user_settings WHERE username=?Array ( [0] => user1@mydomain.com ) SELECT * FROM user_settings WHERE username=?Array ( [0] => user1@mydomain.com ) INSERT INTO online (username, ts, last_activity, ipaddr) VALUES(?,?,?,?)Array ( [0] => user1@mydomain.com [1] => 1409122488 [2] => 1409122488 [3] => 123.231.214.25 ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/piler.mydomain.com/system/database/mysql.php:47) in /var/www/piler.mydomain.com/controller/login/login.php on line 64 -
repo owner Well, hell of the job to decrypt this blob :-) Next time please use some bitbucket formatting. I'll check why the 5th query gives a warning.
-
reporter Hi Janos, sorry about that, sadly bitbucket ignores my linebreaks.
-
repo owner No problem, though you may use the formatting icon. Anyway, please check out the latest master branch if it solves the problem.
-
repo owner - changed status to resolved
- Log in to comment
Hmm, odd. Can you guess, which is the guilty query? You may add some debugging by editing /var/www/htdocs/system/database/mysql.php, and add the following to the catch block in the 48th line: