SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Nothing after <body>

    Hello! I got the book "Build your own database driven website using php & mysql 3rd edition". In the end of Chapter 4 it tells you how to connect (and add) to a mysql database. I wrote down exactly that code in the book, but all I get is a white page, and when i look at scourcecode it's correct to <body>, but there's nothing after it! Anyone who read the book know what's wrong? Thank you.

  2. #2
    SitePoint Addict tina88's Avatar
    Join Date
    Jan 2007
    Location
    UK
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hiya, welcome to the forums Can you post your full code for the page?

  3. #3
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Syntax error and error reporting and/or error display off. Turn them on in your php.ini
    Saul

  4. #4
    SitePoint Evangelist Alluvian's Avatar
    Join Date
    Jan 2007
    Location
    Orlando, FL
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Joakim123 View Post
    Hello! I got the book "Build your own database driven website using php & mysql 3rd edition". In the end of Chapter 4 it tells you how to connect (and add) to a mysql database. I wrote down exactly that code in the book, but all I get is a white page, and when i look at scourcecode it's correct to <body>, but there's nothing after it! Anyone who read the book know what's wrong? Thank you.

    I have no idea what is in chapter 4 of that book, but connecting and adding data to a database would not display anything to the webbrowser unless there was an echo or a print or something in there to display a success or failure message.

    As has been said earlier, please post the code you are having trouble with.

    You might want to check mysql if you know how and verify that the commands are not working perfectly well but just not displaying any messages.

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php_daemon knows best: Just make sure

    error_reporting = E_ALL

    is in your php.ini

    Don't forget to restart Apache/IIS

  6. #6
    SitePoint Enthusiast wyte raven's Avatar
    Join Date
    Feb 2007
    Location
    England, High Wycombe Bucks
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hiya Mate!

    I may be wrong, but I get the feeling I'm right. I copied the code exactly as it was displayed in this book. However, the book mentions that you should install to C:\php. If this is the case, and you have followed this instruction, (and you have recently installed say PHP 5.2) then your problem is not a syntax error. Instead it's a configuration setting in your php.ini file. You'll find that php may have actually installed to something like C:\php\php12345. Again, I could be wrong, but this is the problem I had, I changed it, and all my scripts (requiring connection to a database) came to life. Your problem is that you aren't connecting to your database, thats why you got to chapter 4 of the book, all of the code snipets up to this point, haven't required you to connect to a database.

    Read my post at the bottom of this link:
    http://www.sitepoint.com/forums/show...ight=jokes.php

    I hope this helps you buddy.
    Wyte R@ven - Creator of the Rift


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
  •