PDA

View Full Version : MySQL - PHP Question/Help


Alcar
Wed 28th Aug '02, 8:49am
Hello there,

The following code is something i've been making myself and it just won't work, I know that the server i'm on allows MySQL and PHP, and I have a my own database.

The problem im guessing must be in my coding...It is setting up tables in the database... The $dbserver, $dbusername, $dbpassword and $dbdatabase are all already set.

$mysqlaccess= mysql_connect($dbserver, $dbusername, $dbpassword);

mysql_select_db($dbdatabase, $mysqlaccess);

$optionstblcreate= "CREATE TABLE options (
name VARCHAR(40) NOT NULL
version VARCHAR(15)
contact VARCHAR(100) NOT NULL
status VARCHAR(10) NOT NULL
siteaddress VARCHAR(50) NOT NULL
cpdirectory VARCHAR(10) NOT NULL
allowbans VARCHAR(5) NOT NULL
bannedips TEXT
placeholder TEXT NOT NULL
)";

mysql_query($optionstblcreate, $mysqlaccess);

print 'Options table set up successfully<p>';

$templatestblcreate= "CREATE TABLE templates (
name VARCHAR(40) NOT NULL
path VARCHAR(250) NOT NULL
navigation VARCHAR(150) NOT NULL
content TEXT NOT NULL
useplaceholder VARCHAR(5) NOT NULL
submenucontent TEXT
status VARCHAR(10) NOT NULL
moderator VARCHAR(50)
)";

mysql_query($templatestblcreate, $mysqlaccess);

print 'Templates table set up successfully<p>';

$stafftblcreate= "CREATE TABLE staff (
name VARCHAR(40) NOT NULL
usergroup VARCHAR(25) NOT NULL
password VARCHAR(20) NOT NULL
email VARCHAR(60) NOT NULL
)";

mysql_query($stafftblcreate, $mysqlaccess);

print 'Staff table set up successfully<p>';

$styletblcreate= "CREATE TABLE style (
bgcolor VARCHAR(6) NOT NULL,
tblheadcl VARCHAR(6) NOT NULL,
tblsubcl VARCHAR(6) NOT NULL,
scrollcl VARCHAR(6),
scrollarrwcl VARCHAR(6),
leftmargin INT(4) NOT NULL,
topmargin INT(4) NOT NULL,
normftcl VARCHAR(6) NOT NULL,
normftface VARCHAR(25) NOT NULL,
normftsize INT(2) NOT NULL,
smallftcl VARCHAR(6) NOT NULL,
smallftface VARCHAR(25) NOT NULL,
smallftsize INT(2) NOT NULL,
pgnameftcl VARCHAR(6) NOT NULL,
pgnameftface VARCHAR(25) NOT NULL,
pgnameftsize INT(2) NOT NULL,
pgnameftwgt VARCHAR(25) NOT NULL,
pgnameftltspac INT(2) NOT NULL,
pgnamefttxttrans VARCHAR(15) NOT NULL,
sctnameftcl VARCHAR(6) NOT NULL,
sctnameftface VARCHAR(25) NOT NULL,
sctnameftsize INT(2) NOT NULL,
sctnameftwgt VARCHAR(25) NOT NULL,
sctnameftltspac INT(2) NOT NULL,
lnksnonhovcl VARCHAR(6) NOT NULL,
lnksnonhovtrans VARCHAR(25) NOT NULL,
lnkshovcl VARCHAR(6) NOT NULL,
lnkshovtrans VARCHAR(25) NOT NULL,
frmscl VARCHAR(6) NOT NULL,
frmsface VARCHAR(25) NOT NULL,
frmssize INT(2) NOT NULL,
frmsbgcl VARCHAR(6) NOT NULL,
)";

mysql_close();

Any help is appreciated! :)

Alcar...

Steve Machol
Wed 28th Aug '02, 2:06pm
Since you have a vB forum in your sig, could you please follow the instructions in my sig to register for Priority Forums Support? Thank you.

Dan615
Wed 28th Aug '02, 3:23pm
For one thing, you never executed the last MySQL query...second, what errors do you get? Are they MySQL errors or PHP errors (parse error or something)?

Alcar
Wed 28th Aug '02, 6:53pm
Ah, I could do that but I wouldn't want to impose anything on the Administrator...

Im simply a Super Moderator with Administrative access :D I might try...

Errors? Well not getting any, but when I try and read information after doing something like this:

$optionsfirsttimesetup= "UPDATE options SET name='$name',version='$version',email='$email'";

mysql_select_db($dbdatabase);
mysql_query($optionsfirsttimesetup, $mysqlaccess);
mysql_close();

Alcar...

Steve Machol
Wed 28th Aug '02, 6:57pm
Sorry you cannot receive vB support on these forums unless you can show you are working on a licensed forum. To do so you will have to ask the owner of that license to enter your username in the Priority Forum Support box. Thanks for your cooperation.