SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 23rd, 2002, 11:05 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
Lightbulb a challenge for all.....

I am not sure if this can be done in PHP... but if so, I wonder if anyone out there might lend a hand and help me to do it!!

I need to set one PHP script, which, when called it will set up a default user account in 'user' table, and set up the remaining tables...

I want to set up around 5 tables with content... and I need to create the install file. I already have all the SQL to insert the data in to the tables, and it works when I run install.sql in myPHPadmin. BUT..... I want to create install.php which anyone can run on their server and it sets up all the tables.

do I need to create the default user, or would the user have to log in to MyPHPadmin to create the database?

is this clear....?!!
hehe!
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #2  
Old September 23rd, 2002, 07:35 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
firslty create a form, that collects the user database info, like server, username and password, and database name, when they submit, create a database.php doc, and store the variables in there, then use those variables to connect to the server and create your datbase and tables

Reply With Quote
  #3  
Old September 24th, 2002, 09:19 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
or if you don't want to use ph pfile functions

just make an easy to edit config file that's included in your install.php script. all you need it to contain is the server-specific info to connect to mysql, ie. hostname, username, password, and database to connect to. You can go ahead and connect in the config file too, to keep it neat.

In your main file, just run your queries one after the other until they're all finished. You won't typically need to walk the user through making any mysql configuration changes, because more often than not they either set it up themselves or have a web host that set it up for them, and in either case have the login info needed to add tables.

if you need to have them create some user, you can do it by having them run the mysql shell as the root user, and entering a single command.

shell> mysql --user=root password
mysql> GRANT ALL PRIVILEGES ON *.* TO username IDENTIFIED BY password;

Of course username/password will be specific to the server, and you can have the privileges more selective, but that will set a user up. If you want more restrictive permissions, you can give the user insert only permissions, just to that database, but there's no real need to do this.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > a challenge for all.....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway