core icon indicating copy to clipboard operation
core copied to clipboard

Update Views.class.php

Open rowright opened this issue 4 years ago • 1 comments

Switches $form_id to :form_id in binding

rowright avatar May 21 '21 03:05 rowright

References #783 stack trace

ghost avatar May 21 '21 03:05 ghost

I installed this using Softaculous on Hostgator and was getting "Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number". Making this correction fixed the issue. When do you think the newest version will get deployed? The version that it installs is 2 years old. Thank you!

eharvey71 avatar Dec 15 '22 22:12 eharvey71

really nice project but many little careless misdtakes. found this too.. views.class.php 911 WHERE v.form_id = $form_id AND -> WHERE v.form_id = :form_id AND also Database.class.php 71 $this->statement = $this->dbh->prepare($query);

which have to be sometimes prepare and sometimes query, a quick and dirty approach would be -> if (strpos($query, " :")) { $this->statement = $this->dbh->prepare($query); } else { $this->statement = $this->dbh->query($query); }

the-ft avatar Jan 18 '23 21:01 the-ft

It's an old project now! I haven't been maintaining it for a few years, but given that people are still using it and it's not compatible with PHP8 I'll take some time in the next few months to add PHP8 support. This fix will get rolled out with the next update. Thanks @rowright!

benkeen avatar Jan 19 '23 02:01 benkeen