SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    See? The nice thing about waiting until Friday for Part Three is that the wait for Part Four doesn't seem so long!


    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I saw it! Except I'm still having problems with MySQL so I'm going to quickly post so I can continue to follow.

    Looks great!!

  3. #3
    SitePoint Member
    Join Date
    Jun 2000
    Location
    bristol,uk
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been reading through part IV of your tutorial, and I'm unclear about connecting PHP and MySQL. I followed the MySQL section fine, and the PHP section was OK, but I don't think I have the directories structured correctly for PHP to connect to MySQL. Where should I place the MySQL and PHP directories in relation to "http://localhost"?

    Also the php.ini file specifies a doc_root of c:\sambar is this correct or should it be c:\sambar\docs, as this is where I run the .php scripts from?

    Any help would be appreciated.

  4. #4
    Non-Member
    Join Date
    Apr 2000
    Location
    Waco, Texas.
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great article! I have a question though. Could you use "OR DIE()" rather than the if(!$db)?

    For example, is it possible to do the following:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    $db = @mysqL_connect("host","login","password) or die("Cannot Connect:" . mysql_error());
    [/code]
    ?
    Thanks



    ------------------
    http://www.wiredstart.com The technology start page

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great article Kevin! After last week's article I got all anxious and found something on WebMonkey to allow me to do basically what you did, but it ended up being a great idea, it introduced me to some of those commands a bit early, so I found it much easier to follow along! What's the next article set to be about? The template system?



    ------------------
    Chris Bowyer
    MyCoding.com: Join our mailing list for launch notification!
    "I'm not an insomniac, I'm a web designer."

  6. #6
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chris B,

    The doc_root is the folder you'll be accessing if you go to http://localhost/ in your browser.

    Also MySQL doesn't need to be in the doc root, in fact it is VERY insecure if it is. That means anyone can read your databases. Just leave them wherever they are, like C:\mysql\data\ .

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Chris B,

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>I followed the MySQL section fine, and the PHP section was OK, but I don't think I have the directories structured correctly for PHP to connect to MySQL. Where should I place the MySQL and PHP directories in relation to "http://localhost"?
    Also the php.ini file specifies a doc_root of c:\sambar is this correct or should it be c:\sambar\docs, as this is where I run the .php scripts from?<HR></BLOCKQUOTE>

    The MySQL and PHP directories may be placed anywhere on your hard drive. As d3v points out, these should really not be placed anywhere near the Web server's document directory. Your Web server communicates with PHP with its "plug-in" interface (ISAPI, in the case of Sambar Server), and PHP communicates with the MySQL server over TCP/IP. As long as the MySQL server is running, PHP should be able to connect to it. Let me know if this is not the case!

    Indeed, your doc_root should be set to c:\sambar\docs (although this is not a huge deal).

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>
    Great article! I have a question though. Could you use "OR DIE()" rather than the if(!$db)?
    <HR></BLOCKQUOTE>

    Yup, you can use that if you prefer. I stuck with an "if" statement because it was easier to explain. I may present the "OR &lt;function&gt;" trick in a later article if it proves appropriate.



    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!


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
  •