formtools / core

The Form Tools Core.
https://formtools.org
205 stars 78 forks source link

Update Views.class.php #794

Closed ghost closed 1 year ago

ghost commented 3 years ago

Switches $form_id to :form_id in binding

ghost commented 3 years ago

References #783 stack trace

eharvey71 commented 1 year ago

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!

the-ft commented 1 year ago

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); }

benkeen commented 1 year ago

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!