mevdschee / php-crud-api

Single file PHP script that adds a REST API to a SQL database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Found this PDOException occurred (enable debug mode) in message

Hakkey opened this issue · comments

Screenshot (118)

i got this error when i tried to fetch the "users" table from my db of mysql

what is the possible error for this? thanks!

Hi. Something went wrong in the PDO driver. Please enable debug in the config and check the (HTTP) response headers in the network tab of the developer tools. Kind regards, Maurits

Screenshot (120)

is it this one?

There is a config setting named "debug" and it should be set to "true" and the "Headers" tab is two tabs to the left on the screenshot.

i have found the error which why the connection is refused, so in my case the database is from another host let's say "10.9.0.0.1". Is there a way to pass the db host to the config model?

Yes, you can set the "address", as per README:

"address": Hostname (or filename) of the database server (localhost)

from: https://github.com/mevdschee/php-crud-api?tab=readme-ov-file#configuration

Okay got it, thanks!

Cool project anyway keep it up