0
votes

I currently understand that in a full overview, a client will interact with the front-end of a website, then the website will process that transaction and perhaps create a file, the the file will go to the backend, backend will do something with the file (perhaps record it in a dbms), and then it will shoot a result back to the front-end.

For example, imagine we had a javascript website where users enter information which we want to record into a MySQL database. How does this process work? Obviously, we want to have an HTML in the website, and it the will "post" to a specific file. But, MySQL databases don't seem to exist as files, like I can't find a ".sql" file anywhere on my computer. Where do I exactly "post" to? And perhaps, once the user's information is recorded, I want the server to reply back with "You are the Nth submitter! Thanks." How do I exactly take information about a table in MySQL and respond with it?

The general high-level explanation of front/back end coding makes sense, but then when I get to actually trying to implement an example, I don't even know where to begin.

1
The .sql file extension is usually used for sql scripts, not databases.Mr Lister

1 Answers

2
votes

You post to an HTTP server (such as Apache HTTPD). The HTTP request includes a URL and the data.

The HTTP server uses something like mod_fcgid to map the URL onto a program (written in the language of your choice) using and passes along the request.

That program connects to the local database server and uses MySQL's custom protocols to send the query.

The local database server then stores the result in a file (which isn't a .sql file).