how to make an install script

Codes here !

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 8
Joined: Thu Jan 02, 2003 2:28 pm

Sun Jun 22, 2003 6:13 am

I've just finished making a content management system and want a script to install the tables and insert the provisional pass/username. On my first attempt I used the mysql_query () for each create table. This worked fine except err.. the prefix of each table e.g esm_writer_permissions had turned into ESM_writer_permissions. And some tables refused insert commands. I ended up having to paste the SQL into the phpMyAdmin directly.

This isn't a big deal for me but for some users it would. Is there some way of doing it by php instead?

User avatar
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens

Sun Jun 22, 2003 4:00 pm

Have a look on mysql_ functions. You can create tables and insert your pre-configured data inside. Assume that users should first have a database with a valid user/pass.
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6

Mike Vassileiou
[Systems Administrator / PHP Developer]

PHP/MySQL Manual:

New php-forum User
New php-forum User
Posts: 11
Joined: Wed Jun 25, 2003 5:07 am

Thu Jun 26, 2003 11:32 am

You might try looking at some free/Open Source PHP/MySQL apps that use install scripts. phpBB ( comes to mind. Just download it and then look at the code for its install script.
I am elToro. Feel my fury.

Post Reply