Current location: Hot Scripts Forums » Programming Languages » PHP » install query?!?


install query?!?

Reply
  #1 (permalink)  
Old 03-25-06, 10:41 AM
N@$$! N@$$! is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
install query?!?

I want to make a install script to run this query into the mysql database
PHP Code:

CREATE TABLE `gebruikers` (

`
idint(5NOT NULL auto_increment,
`
nicknamevarchar(100NOT NULL default '',
`
wachtwoordvarchar(100NOT NULL default '',
`
emailvarchar(100NOT NULL default '',
`
actieftinyint(1NOT NULL default '0',
`
ingelogdtinyint(1NOT NULL default '0',
`
ipvarchar(15NOT NULL default '',
`
rangvarchar(100NOT NULL default 'user',
PRIMARY KEY (`id`)
TYPE=MyISAM
In the config file I've already introduced data for the database. tOnly you have to do is include the config.php file. bud how do i mak a install script!?!

greetz N@$$!
Reply With Quote
  #2 (permalink)  
Old 03-25-06, 10:57 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
You have this query in an config file and want to install it from there?
How does the config file look like? Something like this?


PHP Code:



$query 
"
 CREATE TABLE `gebruikers` (
`id` int(5) NOT NULL auto_increment,
`nickname` varchar(100) NOT NULL default '',
`wachtwoord` varchar(100) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`actief` tinyint(1) NOT NULL default '0',
`ingelogd` tinyint(1) NOT NULL default '0',
`ip` varchar(15) NOT NULL default '',
`rang` varchar(100) NOT NULL default 'user',
PRIMARY KEY (`id`)
) TYPE=MyISAM;  
"

In this case require the config file in the installation file and run the query using mysql_query()

PHP Code:



require("config.php");

// Make sure you connected to the database before getting to this point.

mysql_query($query); 
Reply With Quote
  #3 (permalink)  
Old 03-25-06, 11:17 AM
N@$$! N@$$! is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
no, I want to make a install script for this query. forget the config.php file!;-)

greetz N@$$!
Reply With Quote
  #4 (permalink)  
Old 03-25-06, 05:42 PM
wiremind wiremind is offline
Newbie Coder
 
Join Date: May 2004
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Create a install.php file, put your database settings in there and run your Create Table query.
__________________
Online Dating Software
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
code problem throws error matt001 ASP.NET 0 10-23-05 03:30 AM
Please Help me for Query by Date Range. ishaqani ASP 8 02-25-05 11:02 AM
Nested Query in PHP/MYSQL truesilentassassin PHP 2 07-27-04 07:50 PM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 07:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.