Welcome to the Treehouse Community
Looking to learn something new?
PHP MySQL Forms
I am looking for a Course that goes over using Forms to Query a MySQL database. I see PHP courses and PHP with MySQL, but I presume I am not looking in the right places as I do not see a video that talks about how to use a form to do this.
I am aware of how to use php to query a database with fixed variables, but I want to learn how to use a form to do this.
Thanks in advance.
Andrew Shook31,709 Points
Elric, can you give a more specific example? For instance, are you trying to create a search function?
The broad answer to your question is that you set the form's method = post ( you could use get, I just perfer post). Then you can retrieve the form info from the $_POST variable and use it to query the database.