jan-vandenberg / cruddiy

No-code Bootstrap PHP CRUD generator
http://cruddiy.com
GNU Affero General Public License v3.0
252 stars 80 forks source link

Saving/ Editing records not workign #138

Open troy-cf opened 2 months ago

troy-cf commented 2 months ago

Warning: mysqli_stmt::execute() expects exactly 0 parameters, 1 given in /../website_1d1f493f/users/t_ss_users-update.php on line 83

I picked a simple table with no relationships and this is what I get.

germain-italic commented 2 months ago

Please provide your PHP and MySQL version and a database schema.

troy-cf commented 2 months ago

I went in to the code that was auto generated and If I change the way paramaters are bound form the first way to the second it works.

  try {
        $stmt->execute([ $name,  $phone ]);
    } catch (Exception $e) {
        error_log($e->getMessage());
        $error = $e->getMessage();
    }

try { $stmt->bind_param("ss", $name, $phone); $stmt->execute(); } catch (Exception $e) { $error = $e->getMessage(); }

The auto generated code doesn't run on my php PHP 7.4 apparently. Is there a way to change it so it uses this style?

germain-italic commented 2 months ago

Check in templates/entity-create.php and templates/entity-update.php.