1 / 8

Database to HTML and Back again A programmers tale

Database to HTML and Back again A programmers tale. 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

argus
Download Presentation

Database to HTML and Back again A programmers tale

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database to HTML and Back againA 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

More Related