Results 1 to 4 of 4

Thread: More mySQL Problems [Resolved]

Threaded View

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Angry More mySQL Problems [Resolved]

    I have mySQL running on my computer here, and all works fine: using PHP I can enter data, and view it.

    However, on the server, it just won't work.

    I keep getting this error:


    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/mendhak/public_html/slambook/view.php on line 23
    The code I'm using is

    PHP Code:

    $dbh
    =mysql_connect("localhost""mendhak_hello""zzz") or die ('I cannot connect to the database because: ' mysql_error());
    mysql_select_db("slambook");  




    $abcquery "SELECT * FROM slambook;";

    $result mysql_query($abcquery);

    echo 
    $result;






    $rowsonthispage mysql_numrows($result); //this is line 23, where the error is occuring



    echo "There are $rowsonthispage rows in total";
    mysql_close(); 
    I've also tried using mysql_num_rows, and I still get the same error. Now, it's obvious there's a problem with what $result is retrieving, but why is that? The query is perfectly fine. The database name is slambook, and the table name is also slambook... is that causing problems?

    What can I do to resolve this problem?
    Last edited by mendhak; May 17th, 2003 at 05:43 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width