Announcement

Collapse
No announcement yet.

error question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • error question

    PHP Code:
    <html>
    <header>
    <title>Listing 12.2 Opening a connection and selecting a database</title>
    </head>
    <body>
    <?php
    $user 
    "myusername";
    $pass "mypassword";
    $database "myusername";

    $link mysql_connect"localhost"$user$pass );

    if ( ! 
    $link )
        die( 
    "Couldn't connect to MySQL" );

    print 
    "Successfully connected to server<p>"

    mysql_select_db$database 

                    or die ( 
    "Coudln't open database" );

    //    or die ( "couldn't open $db: ".mysql_error() );

    print "Successfully selected database \"$database\"<p>";

    mysql_close$link );

    ?>

    </body>
    </html>
    I get an error on the line that says
    mysql_select_db( $database
    NXSupport Admin

  • #2
    semicolon! (line before)

    print "Successfully connected to server<p>";

    Comment


    • #3
      thanks, but Zoombie already told me over aim
      NXSupport Admin

      Comment


      • #4
        You talk to dead people?!

        Comment


        • #5
          lol no:
          http://vbulletin.com/forum/member.ph...threadid=40896
          NXSupport Admin

          Comment

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