SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Toledo, Ohio, USA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been following along Kevin Yank's article and learning how to use PHP and MySQL.

    However, here's a roadblock that I'm encountering with the Jokes database source code provided in the tutorial. I am getting various errors.

    http://www.av1998.f2s.com

    Please click through everything and try everything out extensively. If you have any idea about the errors, please share some helpful advice so that I may fix my mistakes.

    Thank you very much.

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Error retrieving categories from database!
    Error: No Database Selected

    Supplied arguement is not a valid MySQL result resource

    These the messages I notice around your site. Sounds like you are missing a database connection. Please post your code where you connect to the database. It should look something like this:

    $conn = mysql_pconnect("addressOfServer", "user", "passwd");
    mysql_select_db("databaseName", $conn);

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Toledo, Ohio, USA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is my database connection coding.


    $dbcnx=@mysql_connect("db.av1998.f2s.com", "av1998", "******");
    mysql_select_db('jokes');


    It is pretty much the way that the tutorial gave out, I didn't really change anything.

    Please help.

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, I have an account at f2s too. When I set up my mysql database the name of the database they created for me was the same as my account name. Which suggests to me that your database should be named "av1998" and you would need to use:

    mysql_select_db('av1998');


  5. #5
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Toledo, Ohio, USA
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still getting all sorts of errors, even after changing the database name to av1998.

    I am wondering if the tutorial's syntax is compatible with f2s configuration .....

  6. #6
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the good news is it appears that PHP is connecting to your database now. The bad news is, it can't find the tables Authors, Jokes and Categories. Check that you have your database schema set up correctly. Check your table structure by logging into your membership area at http://www.f2s.com then go to your "database" page and click on "Web Database Tool" and loggin to mysql server using the phpMysqlAdmin interface and check that you have the tables set up correctly.

    Error: Table 'av1998.Authors' doesn't exist
    Error: Table 'av1998.Jokes' doesn't exist
    Error: Table 'av1998.Categories' doesn't exist


Bookmarks

Posting Permissions

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