In your rent.php file, you have an error that causes a "Fatal error: Call to a member function execute() on boolean" message when you try to submit the form. This error occurs because the $req->prepare() call is returning FALSE instead of a statement object.
Root Cause:
The main issue is that you have a typo in your SQL query: you have written "INSET" instead of "INSERT". This typo causes $req->prepare() to fail and return FALSE instead of a statement object.
Solution:
To fix the error, simply correct the typo in your SQL query:
$req = $conn->prepare('INSERT INTO renter (email, msg_text) VALUES(?, ?)');
Additional Notes:
The above is the detailed content of Why Am I Getting "Fatal Error: Call to a member Function execute() on Boolean" in "rent.php"?. For more information, please follow other related articles on the PHP Chinese website!