Tutorials » Backend:
Keyword search using MySQL / PostgreSQL / MSSQL / InterBase / ODBC, PHP and Flash 4 - Page 3
Database SetupThe first thing you need to do is create the database structure. This can be accomplished using a GUI like phpMyAdmin, WebMin or from the shell account as follows:
MySQL Database/Table Creation Script
CREATE DATABASE mydatabase; USE mydatabase; CREATE TABLE keyword_data ( id int(11) DEFAULT '0' NOT NULL auto_increment, keywords varchar(120), question varchar(240), answer text, PRIMARY KEY (id) );
Note: You need not create a new database, you can use an existing one.
Now we want to insert some test data, it will come in handy later while testing the Flash. I've provided for a few possibilities with the data below.
MySQL Database Insert Script
INSERT INTO keyword_data (keywords, question, answer) VALUES ('contact reach phone address','How may we contact you?','Smoke signals are the best way to get a hold of us.'); INSERT INTO keyword_data (keywords, question, answer) VALUES ('music mp3','Can I download your mp3s?','Yes, while you will have to sacrifice your first born child though.'); INSERT INTO keyword_data (keywords, question, answer) VALUES ('phone toll free number','Do you have a toll free number?','Yes.');
Note: I suggest you insert just a few records right now, just in case you can't get the scripts working.
|» Level Advanced|
Rating: 8.04 Votes: 48
|I work for a Canadian software company as a logisitics director. We provide custom configured Linux distributions. In my spare time I sleep.|
|Download the files used in this tutorial.|
|Download (103 kb)|
|More help? Search our boards for quick answers!|