I'm new to PHP and mySQL. When I'm running PHP on my web page, and trying to get info from mySQL, this is all I get:

Resource id #2

Can anyone tell me what it means?

Thanks!!

Steve

    I can. So can the manual. It means you're trying to print out the database connection itself (the "resource") instead of getting information out of it and printing that.

      Wingnut,

      Have a look here - it looks like you're using the mysql_query() function incorrectly.

      hth, njm

        Well, here's what I have for the code. Anything really wrong jump out at you?

        $host="localhost";
        $user="Web1";
        $password="";
        $connectDB=mysql_connect($host,$user,$password)
        or die("Couldn't connect to database.");
        $db=mysql_select_db("MailList",$connectD😎
        or die ("Couldn't select database.");

        $query="SELECT * FROM contacts";
        $result=mysql_query($query)
        or die("Couldn't execute query.");
        echo $result;

          Refer to the two replies above. The return value for mysql_query() isn't a recordset, it's a resource.

            I'm so confused. Guess its back to the book......

              Write a Reply...