Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: MySQL error !!!

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry MySQL error !!!

    Hello All,

    Okay I have this MYSQL code, but FOR some REASON ITS NOT WORKING!

    This is the code,, what is wrong???
    ---------
    <?php


    //Making mysql connection
    include("mysql_connect.php");

    //Creating the table for member control

    $query="CREATE TABLE members (user_id MEDIUMINT(5) NOT NULL AUTO_INCREMENT);";

    //Making mysql query
    $result = @mysql_query($query);

    if($result){
    echo("The MySQL Table 'members' has been created. You may now populate it!");
    exit;
    }else{
    echo("MySQL has a problem");
    exit;
    }

    ?>
    ----------------------

    The mysql_connection.php script makes the connection to the database. This works, since it was tested. and it makes the connection. Every time I try to make the table members with the user_id in it, it keeps showing MySQL has a problem.

    Please any help is greatly appreciated!!!
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Below this line:

    echo("MySQL has a problem");

    add

    echo mysql_error();

    Also, on this line

    $query="CREATE TABLE members (user_id MEDIUMINT(5) NOT NULL AUTO_INCREMENT);";

    Try taking the first ; off

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey Nightfire,

    It is now working!

    It was the ;

    Thanks!
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog


  •  

    Posting Permissions

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