www.webdeveloper.com
Results 1 to 2 of 2

Thread: mysql_select_db(): supplied argument is not a valid MySQL-Link resource

  1. #1
    Join Date
    Feb 2010
    Posts
    1

    mysql_select_db(): supplied argument is not a valid MySQL-Link resource

    Hey, guys.

    Here's my code:
    $host = 'localhost';
    $user = 'aaa';
    $pass = 'bbb';
    $db = mysql_connect($host, $user, $pass) || die("something went wrong");

    $dbName = "menkaur_moviesite";

    mysql_select_db($dbName, $db);

    at the resulting page i'm getting error message:
    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/menkaur/public_html/php/index.php on line 17

    what's the problem?

  2. #2
    Join Date
    Feb 2009
    Posts
    102
    try this:

    PHP Code:
    <?php mysql_select_db($dbName$db) || die(mysql_error()); ?>
    That might give you more information about what went wrong.
    -Steve


    "Build a man a fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles