Announcement

Collapse
No announcement yet.

MySQL - PHP Question/Help

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL - PHP Question/Help

    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.

    PHP Code:
    $mysqlaccessmysql_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...
    http://www.oddworldforums.net

  • #2
    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.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      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)?

      Comment


      • #4
        Ah, I could do that but I wouldn't want to impose anything on the Administrator...

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

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

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

        mysql_select_db($dbdatabase);
        mysql_query($optionsfirsttimesetup$mysqlaccess);
        mysql_close(); 
        Alcar...
        http://www.oddworldforums.net

        Comment


        • #5
          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.
          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X