0

Hey how will I write a text file to setup a database with the information below

Database set-up:

Members Table:
id - int primary key auto_increment.
username - varchar 15.
password - varchar 32. will be a md5 and sha1 hash of the password then the username.
e-mail - varchar 35.
admin - tinyint. will either be a value of 1 (admin) or the default, 0 (regular member)
last_ip - varchar 15. will store the last ip address person logged in with.

Buddy List:
uid - User ID from members table. int.
buddy - Buddies username or id. either varchar 15 or int.
blocked - Blocked users username or id. either varchar 15 or int.

Messages:
id - message id. int primary key auto_increment.
from - users name. varchar 15 characters.
to - buddies name. varchar 15 characters.
message - blob
time - timestamp CURRENT_TIMESTAMP.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Fest3er
0

You're on your own for accessing the MySQL server.

The following statements usually work for creating databases and tables:

create database;
use;
create table a (field1, field2, ..., key);

Download the MySQL manual (PDF) and peruse the syntax of the aforementioned statements. I taught myself MySQL by RTFMing, though I did have a slight head start by having learned Informix 15 years earlier, so SQL wasn't a completely foreign language.

N

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.