I am trying to connect to a table or database for the first time. Unfortunately, neither option is working. I have followed the documentation for both Content from a spreadsheet and Content from a database, but it is not working. I have also gone through all possible errors with ChatGPT and am now at a loss.
When attempting to connect to the database:
The database exists in my phpMyAdmin account.
When attempting to connect to the database:
The cvs is stored with all the necessary files as described in the documentation.
The config file is read.
The error in the browser console is always:
API did not return an array:
Object { status: ‘error’, message: “No route found for path: ‘products’ and request method: ‘GET’”, code: 404, exception: “Exception”, key: null, file: ‘/daraz/kirby/src/Http/Router.php’, line: 191, details: , route: null }
Hm, there are a few things going wrong. For the db example, you create a model, where the file name is products.php, but inside, the class name is CommentsPage, so this won’t work and it must be called ProductsPage. Also, for the children you assign a template and a model products, while it should be product(without thes, so that it matches the ProductPage` model.
What is the purpose of the route api/products?
Regarding the .csv example, it is not quite clear what is stored in your .csv file, you are using a different file from the one in the example, are the field names correct? And where have you put the csv() function?
In the csv Version that api parts is some leftover part from chat gpt, sry, thats not nessesary for this.
Regarding the .csv example, it is not quite clear what is stored in your .csv file, you are using a different file from the one in the example, are the field names correct?
I am using ;
I just deleted everything except for one line and now it works. So it’s a problem with the values in the table. I’ll get that sorted out. Thank you very much for your help.
I would still be interested in the database solution, though. I would like to run D3js with a database connection.