Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database to HTML and Back again A programmers tale.

Similar presentations


Presentation on theme: "Database to HTML and Back again A programmers tale."— Presentation transcript:

1 Database to HTML and Back again A programmers tale

2 DB to HTML To get information from a Database table into a HTML file we need to use SQL and PHP 1. get the data from the table 2. put the data into PHP variables 3. put the variables into the values attributes or HTML The document is then printed

3 DB to HTML 1. get the data from the table USE SQL SELECT statement The SQL fields and table names must match the table

4 DB to HTML 2. put the data into PHP variables The names of the PHP variables reflect easily recognizable names based on the table and fields. The data from the field names goes into the variable names.

5 DB to HTML 3. put the variables into the values attributes or HTML If you are using a form the variables should go into value attributes in many cases.

6 HTML to DB To get HTML form information into a Database we just reverse the process. 1. Take the HTML form elements and place them into PHP variables 2. Take the variables and put them into a SQL statement.

7 HTML to DB 1. Take the HTML form elements and place them into PHP variables This is first accomplished by naming the name attribute values with recognizable names.

8 HTML to DB 2. Take the variables and put them into a SQL statement. The names of the variables will be the values of the SQL statement. The names to the left of the = signs are the names of the fields


Download ppt "Database to HTML and Back again A programmers tale."

Similar presentations


Ads by Google