SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict Chris Roane's Avatar
    Join Date
    Jul 1999
    Location
    Helena, MT
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    For some odd reason, the code below doesn't work:

    $sql = "CREATE TABLE $name1" . "_users ( " .
    "ID int not null primary key auto_increment, " .
    "Email text not null);";
    If (mysql_query($sql)) {
    echo ("<P>Created $name1" . "_users Table Successfully.</P>");
    } Else {
    echo ("Error creating $name1" . "_users Table.");
    mysql_error();
    exit();
    }

    It brings up the error message "Error creating $name1" . "_users Table.", but that is it. Do you see any errors in that code that might cause that?

    Chris Roane

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put an echo statement to print out the query and you should know what is wrong.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $sql = "CREATE TABLE ". $name1 ."_users (" .
    "ID int not null primary key auto_increment), " .
    "Email text not null)";
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, based on freddy's post, I believe you could use this (since I do all the time)

    $sql = "CREATE TABLE '$name1'" . "_users ( " .
    "ID int not null primary key auto_increment, " .
    "Email text not null);";
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    SitePoint Addict Chris Roane's Avatar
    Join Date
    Jul 1999
    Location
    Helena, MT
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It still isn't working and I tried all the ways you guys suggested and several of my own ideas. This is starting to get a little frustrating.

    Are there any more ideas on how I can get this to work?

    Thanks for your help!

    Chris Roane

  6. #6
    SitePoint Addict Chris Roane's Avatar
    Join Date
    Jul 1999
    Location
    Helena, MT
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just thought of this but could the reason why it isn't working right is because I am not allowed to "create a table" like that in my mysql database? I really have no idea why else it wouldn't be working.

    Chris Roane

  7. #7
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nah, I don't thing that you can't create new table.
    Try to create a super simple table and see what is wrong.

    Do you want to give me a real query (echo($sql) so I could test it?
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

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