Php/MySQL Question

O

old.AdrAs

Guest
Wel ive got the following script:
<?php
$hostname = "barrysworld.com";
$username = "????";
$password = "????";
$dbName = "database";
$zone = "MET";
$sendmail = "no";
$mailadress = "";

mysql_connect($hostname, $username, $password) OR DIE("Unable to connect to database");
mysql_select_db( "$dbName") or die( "Unable to select database");

$result = MYSQL_QUERY("create table ci_members (ID INT(4) NOT NULL AUTO_INCREMENT,Nick VARCHAR(30) NOT NULL,FirstName VARCHAR(30) NOT NULL,EMail VARCHAR(30) NOT NULL,TelNr VARCHAR(30) NOT NULL,Home VARCHAR(30) NOT NULL,UIN INT(4) NOT NULL,TimeStamp INT(4) NOT NULL,RankForumRG INT(1) NOT NULL,RankForumQ3 INT(1) NOT NULL,RankForumCS INT(1) NOT NULL,RankForumCO INT(1) NOT NULL,RankForumLA INT(1) NOT NULL,RankForumSP INT(1) NOT NULL,RankTactics INT(1) NOT NULL,RankShedule INT(1) NOT NULL,RankPoll INT(1) NOT NULL,RankMembers INT(1) NOT NULL,RankNews INT(1) NOT NULL,RankFiles INT(1) NOT NULL,Posts INT(3) NOT NULL,Password VARCHAR(30) NOT NULL,NewTimeStamp INT(4) NOT NULL,OldTimeStamp INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_tactics (Topic VARCHAR(30) NOT NULL,Creator VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Game VARCHAR(2) NOT NULL,ID INT(4) NOT NULL AUTO_INCREMENT,Text blob NOT NULL,PRIMARY KEY (ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_warplaner (TimeStamp INT(4) NOT NULL,ID INT(4) NOT NULL AUTO_INCREMENT,GameTyp VARCHAR(15) NOT NULL,Game VARCHAR(2) NOT NULL,Enemy VARCHAR(30) NOT NULL,EnemyUrl VARCHAR(30) NOT NULL,EnemyContact VARCHAR(30) NOT NULL,League VARCHAR(30) NOT NULL,XonX VARCHAR(10) NOT NULL,Maps VARCHAR(30) NOT NULL,Settings VARCHAR(90) NOT NULL,Server VARCHAR(30) NOT NULL,ServerPw VARCHAR(15) NOT NULL,Response BLOB NOT NULL,Posted VARCHAR(30) NOT NULL,Info VARCHAR(90) NOT NULL,Forum VARCHAR(2) NOT NULL,ComID INT(4) NOT NULL,LastChange INT(4) NOT NULL,PRIMARY KEY (ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_files (TimeStamp INT(4) NOT NULL,ID INT(4) NOT NULL AUTO_INCREMENT,Topic VARCHAR(50) NOT NULL,URL VARCHAR(50) NOT NULL,Size VARCHAR(15) NOT NULL,PRIMARY KEY (ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_polls (State INT(1) NOT NULL,TimeStamp INT(4) NOT NULL,ID INT(4) NOT NULL AUTO_INCREMENT,Topic VARCHAR(50) NOT NULL,Creator VARCHAR(50) NOT NULL,Selection BLOB NOT NULL,Response BLOB NOT NULL,ComID INT(4) NOT NULL, ComForum VARCHAR(2) NOT NULL,PRIMARY KEY (ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_news (TimeStamp INT(4) NOT NULL,Topic VARCHAR(50) NOT NULL,Nick VARCHAR(30) NOT NULL,EMail VARCHAR(50) NOT NULL,ID INT(4) NOT NULL AUTO_INCREMENT,CommentID INT(4) NOT NULL,Forum VARCHAR(2) NOT NULL,Text BLOB NOT NULL,PRIMARY KEY (ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_rg (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_q3 (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_cs (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_co (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_la (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("create table ci_forum_sp (Status INT(1) NOT NULL,Topic VARCHAR(50) NOT NULL,Autor VARCHAR(30) NOT NULL,TimeStamp INT(4) NOT NULL,Text BLOB,ID INT(4) NOT NULL AUTO_INCREMENT,PID INT(4) NOT NULL,PRIMARY KEY(ID))") or print(mysql_error()."
");
$result = MYSQL_QUERY("INSERT INTO ci_members (ID,Nick,EMail,Password,RankMembers) VALUES ('1','Administrator','Admin@home.pages','admin','1')");

print "done.";
?>


Do i need to set the $dbName variable ? And what should i put in
?

Which fileextension does this script need ?
 
O

old.AdrAs

Guest
$hostname = "barrysworld.com";
$username = "????";
$password = "????";
$dbName = "database";

What should i enter here.
$hostname ="localhost" ??
$username ="sitename? or adminname?"
$password ="the one of the user above"
$dbName (Name of MySQL database) = "???"
 
O

old.usct

Guest
could you please tell me the database of here????????????
 
O

old.shihan

Guest
there aren't mysql db's avaiable at barrysworld at the moment. but check www.freesql.org ... or was it .com

and your script...hmmm you only have to create the table once, so you don't need to put that in the php script. I haven't read the whole script but I think it's a bit long, you should split your database in some little tables and link them together.
 

Users who are viewing this thread

Top Bottom