Closed btbuses closed 2 years ago
There are two things going on:
PHP Fatal error: Uncaught Error: Call to undefined function mysqli_stmt_get_result()
This means your webserver host has not installed the mysqlnd driver (this is a very common package that should be installed). When you see this error, it is not installed or configured properly.
And another error is this:
Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
This MIGHT be because of the first error, but it might also indicate your database constraints are not properly defined.
Thanks for your prompt reply. I'm using godaddy as the host and have been in contact with them re the first item you mentioned. On my php, it indicates that mysqlnd has been installed, and using v 7.4 of php.
nd_mysqli and nd_pdo_mysql are NOT installed.
When i click on the two items, an error message comes up as "skipped as conflicting"
Sorry but that is something I can not control or fix from my side. Maybe disable some other mysql modules, and try what works and what doesn't. I would be curious to know if this indeed fixes something.
Ok, so had a little win. Now able to view & update 2 of the sets, but there is one set where it'll list the table contents on the index page, can view a record, can open up add & update record BUT it won't allow saving of the record.
It appears the webhost has rolled me back to a much earlier version of PHP and deselected and selected different items as shown in the image here.
So not sure what to do about that one set of pages. I'm wondering if it's something in the table setup of phpmyadmin?
G'day mate, still having issues with one set of tables. I can view the single only record that was created on my localhost, but now that it's been served live, all i can do is see the index, and you can view the record, you can go to the update record and add record pages, but when submit/saved is clicked, it still errors out. The other two sets of tables/indexes are working perfectly since the domain host changed the php extensions.
I've also redid the cruddy setup just for that one table thats giving me issues, all to no avail. Any idea why?
Hi btbuses, it's hard for me to debug based on this information. Maybe if you can share the database (sql dumpfile) I could have a look.
carbridge (1).sql.docx Here is the file
Please try some things and I'll check the logs
I tried: adding employee, page came up but when saving went to 500 error. viewing employee, worked. tried editing employee, page came up but saving went to 500 error.
Aha.
TERMINATED is a reserved keyword in MySQL/MariaDB, you can not have a table or columnname with that name.
The code breaks here
$stmt = $pdo->prepare("INSERT INTO employee (name,email,phone,employee_no,commenced,terminated,position) VALUES (?,?,?,?,?,?,?)");
And my guess is because the columname is 'terminated'. Cruddiy does not (yet) do proper error checking for these cases.
That appeared to have been the issue, never knew about reserved words. Thank you :)
error_log.txt having problems with 'viewing' and 'updating' all 3 different sets of tables, and on two of the tables, it won't allow me to 'add' (will show page, but then error 500 page on submit)