Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Building a table for a blog.... Not Connecting

Discussion in 'Database Discussion' started by Scotty13, Apr 16, 2012.

  1. Scotty13

    Scotty13 Member

    Joined:
    May 21, 2010
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    51
    I'm trying to build a blog_sections_table in phpMyAdmin / MySQL and getting...
    Success in database CONNECTION.....
    no TABLE created. You have problems in the system already, backtrack and debug!

    Here's my table, what 'am I missing?

    <?php

    require_once "connect_to_mysql.php";

    print "Success in database CONNECTION.....<br />";

    $result = "CREATE TABLE blog_sections (
    int(11) NOT NULL AUTO_INCREMENT,
    title varchar(88) NOT NULL,
    ordered int(11) NOT NULL,
    PRIMARY KEY (id),
    ) ";
    if (mysql_query($result)){
    print "Success in TABLE creation!......
    <br /><br /><b>That completes the table setup, now delete the file <br />
    named 'section.php' and you are ready to move on. Let us go!</b>";
    } else {
    print "no TABLE created. You have problems in the system already, backtrack and debug!";
    }
    exit();
    ?>

    Thanks, Scott
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    68
    Enter following code in your script after "print "no TABLE created. You have problems in the system already, backtrack and debug!";";

    echo "\n" . mysql_error();

    It will show you exact error message in your SQL query to know why it is failing.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Scotty13

    Scotty13 Member

    Joined:
    May 21, 2010
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    51
    Thanks, that works for me. S
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    What error did you receive when you enabled that option in your code?

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice