Twitist Forums
Trying to understand how PHP and MySQL works - Am I understanding correctly? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Facebook forums (/forum-14.html)
+--- Forum: Facebook Marketing (/forum-12.html)
+--- Thread: Trying to understand how PHP and MySQL works - Am I understanding correctly? (/thread-49517.html)



Trying to understand how PHP and MySQL works - Am I understanding correctly? - allen - 12-08-2012 09:26 PM

I've read through some articles on Wikipedia, and I am still a bit confused. I just want to make sure I understood it correctly:

1. Client computer sends data request to server via web browser
2. The server receives the data request

3. PHP is a programming language that's embedded in the HTML file, which fetches information from MySQL Database ? Is this correct

4. MySQL is like a program that organizes the data on the Server....kind of like how Quickbooks organize financial data on your PC ? is this correct

5. After the PHP script fetches the data from MySQL - does the information get translated back into HTML and sent to the client browser? Or does it stay in PHP form and the client browser can read PHP? Or, does the PHP script determine which HTML codes to fetch from the server? - I'm confused about how the transition is made between the information fetched from the server hard drive, to the client's browser.

Thanks.


- Colinc - 12-08-2012 09:34 PM

You use the php to manipulate the data in the mysql database. It also reads the data as requested and writes the appropriate html for the browser.


- Astano - 12-08-2012 09:34 PM

1. A client connects to the server.
2. The server then processes the PHP which can connect to a database, MySQL for example. A database stores information in tables which are formed of rows and columns, imagine an Excel document.
3. Once the PHP has got the information from the database it will then output text.
4. If the text is in a format the browser understands, HTML for instance it will be rendered.

Websites like facebook use a database to store information about a person which is then accessed by PHP and rendered by a clients browser as HTML.