SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL/PHP Article Error?

    I read the article on this site about setting up good databases:
    Article

    But I got to the bottom of that page and did everything perfectly right... But on my page it shows these errors:

    PHP Code:
    Warningmysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/onlineh/public_html/test/job_list.php on line 8 
    and

    PHP Code:
    WarningFailed opening 'footer.inc.php' for inclusion (include_path=''in /home/onlineh/public_html/test/job_list.php on line 11 

    How do I fix it?

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you could post the code that you are using, we'll be able to fix it far more easily.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That article appears to be a follow up of another, judging by the first sentance:
    With the database designed and out of the way...
    Your first error leads one to wonder if you actually created the tables 'department' and 'listing' and populated them with data to test against.

    Your second error would indicate you did not create a page named 'footer.php' or if you did it is not in the directory referenced by the include command. That page does not give the code for footer.php but it appears footer.php was simply copyright information anyway so that line can probably be safely eliminated.

    Individual systems vary greatly, and finding tutorials that are up to date can be a challenge also. Many tutorials and code you find online will not work properly as written, but much of it you can pick the code apart and get a gist of what the author was trying to demonstrate. You still need to hit the manual and verify the methods being presented, figure out the concepts involved with the current project, then apply them properly to your application.

  4. #4
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh... I think I see what's wrong. I am using PHP MyAdmin to work on my SQL database and it says to make it the Type "DEFAULT" for a few of the rows... But PHPMyAdmin doesn't have that so I left the field blank, do you know what I should do?...

  5. #5
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by hphogwarts4
    Oh... I think I see what's wrong. I am using PHP MyAdmin to work on my SQL database and it says to make it the Type "DEFAULT" for a few of the rows... But PHPMyAdmin doesn't have that so I left the field blank,
    DEFAULT is not a 'type', it is an instruction to set the field value.
    do you know what I should do?...
    Learn the basics, starting with SQL first.

    PHP is not a point and click language. To my knowledge PhpMyAdmin is not a learning tool, it is an administration tool. I have never used it myself, but when trying to learn PHP/MySql the only uses for it I can see would be to run SQL queries on a database you do not have shell access to, or perhaps to construct a query then have PhpMyAdmin echo the query back so you can analyze the syntax (if PhpMyAdmin gives you that capability, it should)

    There are tutorials all over the 'net teaching basic SQL (some better than others) and the MySql manual includes its own tutorial. I would suggest walking through that entire tutorial (Chapter 3, I believe) to gain a rudimentary level of understanding what you are trying to do. Then you will find integrating it with PHP gains a whole new level of clarity.

  6. #6
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand a lot of it... Anyways, The problem is for the type, in PHPMyAdmin requires it... If it is just blank in the article what should I do about it?

  7. #7
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by hphogwarts4
    I understand a lot of it...
    mm-hmm. Have you scanned down this list to see if there was anything you might not be... shall we say... completely honed?
    http://www.mysql.com/doc/en/index.html
    Anyways, The problem is for the type, in PHPMyAdmin requires it...
    PhPMyAdmin does not require anything, but MySql does. I would get rid of PhpMyAdmin if I were you, I really think it is holding you back!
    If it is just blank in the article what should I do about it?
    You use whatever type is appropriate in that field for your application. Basic stuff here.
    http://www.mysql.com/doc/en/Creating_tables.html


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
  •