hi, sorry my english is not good. that is my problem:
i want to make a form server with slim, and json. when an user want to fill out a form, the server most return to him the data about an user from the database. when the user finished, the data most be seva into the database.
for exemple:
user: get /form
serveur : nom:"" prenom: “”
i dont know how to begin. how can i fill out name without use a form with graphical interface.
@troy, If you haven’t already, read through the First Tutorial Walkthrough. It provides a good example of how to connect Slim to a database, save and retrieve data, etc.
@tflight, I read through the First Tutorial Walkthrough, but I am still unclear as to how to create the database. I am not using MAMP or XAMPP, but connecting to the server via php -S, so how do I get a database up and running using PDO? In other words, do I put the code snippets suggested in the config file and this will eventually connect to MySQL? And what is the MySQL port to use if I were to use Sequel Pro? Thanks in advance.
@ldco2016 The answers to those questions depend on how you installed MySQL. MySQL typically listens on port 3306, but for local development you might use a socket connection.
It has been a long time since I’ve used SQLite. I believe you just initialize the database (an empty text file) using the command line. So something like $ touch db.sqlite3 and then load it through PDO as $db = new PDO("sqlite:/path/to/db.sqlite3");
I’m not sure if Sequel Pro has the ability to connect to SQLite databases.
If you are getting the same error message, I would still be inclined to believe the error message. Otherwise, it isn’t clear where the db object is coming from or what it might do.