Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I access data held in a MySQL database on a web server?

Delphi, PHP and MySQL

How do I access data held in a MySQL database on a web server?

by  towerbase  Posted    (Edited  )
This is a short tutorial implemented as a series of FAQs to show how you can access data held in a MySQL database on a web server.

The FAQs assume that you have reasonable knowledge of Delphi, PHP and MySQL but are unsure how to implement such a system.

The example code will implement a very simple system. The MySQL database contains a table called 'birthdays' which has two columns. The first column contains names of people and is called 'name'. The second column contains birthdates and is called 'born'. The table will have been created using the following SQL:
Code:
CREATE TABLE birthdays ( name VARCHAR(40) PRIMARY KEY NOT NULL, born DATE )

The Delphi application displays a list of people who have a birthday for a given day and month. It gets the information from the 'birthdays' table held on the server.

There are probably components available that will implement much of the Delphi (and possibly PHP) code to do this. However, it can be instructive to write the code yourself.

This tutorial assumes that the 'birthdays' table is populated with suitable data.

The first task is to design a suitable protocol. A protocol is simply a set of rules that the client side Delphi program and the server side PHP script are going to follow.

The second task is to code and test the server side PHP script.

The third task is to code and test the client side Delphi program.


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top