A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: help! can't find the problem

Hybrid View

  1. #1
    AS3 N00B
    Join Date
    Feb 2002
    Location
    NYC
    Posts
    308

    help! can't find the problem in php

    PHP Code:
    <?php
    $server
    ="localhost";
    $user="kotrclan";
    $pass="87kotr";
    $flashbase ="kotrsite";
    $table="match";

    $hookup mysql_connect($server$user$pass); 

    $debase=mysql_select_db($flashbase,$hookup); 

    $sql "CREATE TABLE $table (cname char(100), csite char(100), cplayer char(100), ctype char(100), cmap char(100), cserver char(100), cround1 char(100), cround2 char(100), cfinal char(100), cwinner char(100), cssround1 char(100), cssround2 char(100), cdemoround1 char(100), cdemoround2 char(100))";

    $result mysql_query($sql,$hookup) or die("Tables not created.");

    if (
    $result) {
    echo 
    "Tables have been created.";
    }
    ?>
    the password and everything is correct but yet i can't seem to create the table and fields, plz help. THX IN ADVANCE
    Last edited by neo1487; 10-20-2002 at 07:35 PM.
    -Neo

  2. #2
    __OSX powered__ nucleuz's Avatar
    Join Date
    Aug 2000
    Location
    Norway
    Posts
    836
    What does
    "mysql_query($sql) or die(mysql_error())" give you??
    NuCleuZ :: PHPVolcano :: Blog

  3. #3
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hi,
    think it would help to create a primary key for your table:

    PHP Code:

    <?php
    $server
    ="localhost";
    $user="kotrclan";
    $pass="87kotr";
    $flashbase ="kotrsite";
    $table="match";

    $hookup mysql_connect($server$user$pass); 

    $debase=mysql_select_db($flashbase,$hookup); 

    $sql "CREATE TABLE $table (
    cname char(100), 
    csite char(100), 
    cplayer char(100), 
    ctype char(100), 
    cmap char(100), 
    cserver char(100), 
    cround1 char(100), 
    cround2 char(100), 
    cfinal char(100), 
    cwinner char(100), 
    cssround1 char(100), 
    cssround2 char(100), 
    cdemoround1 char(100), 
    cdemoround2 char(100),
    id int(4) DEFAULT '0' NOT NULL auto_increment,
    PRIMARY KEY (id)
    )"
    ;

    $result mysql_query($sql,$hookup) or die("Tables not created.");

    if (
    $result) {
    echo 
    "Tables have been created.";
    }
    ?>
    Hope it helps..
    3PRIMATES

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center