INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Delphi, PHP and MySQL

How do I access data held in a MySQL database on a web server? by towerbase
Posted: 27 Jul 04

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.



Back to Embarcadero: Delphi FAQ Index
Back to Embarcadero: Delphi Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close