Is my php and mysql interacting?

Discussion in 'Web Design and Development' started by phillipjfry, Mar 8, 2007.

  1. phillipjfry macrumors 6502a

    phillipjfry

    Joined:
    Dec 12, 2006
    Location:
    Peace in Plainfield
    #1
    I'm new to the whole thing. I have started up apache, enabled php in the httpd.conf file. I also installed the precompiled mysql image. After testing out a page with a <?php phpinfo() ?> I noticed in the "Configure Command" it has
    '--with-mysql=/usr'

    The precompiled image of MySQL installed at /usr/local/mysql
    my $PATH's are setup correctly. So my question: is everything setup correctly? :confused:
     
  2. LBmtb macrumors newbie

    Joined:
    Mar 8, 2007
    Location:
    long bizzle, ca
    #2
    How about you test it to make sure it works. Make a php program that creates a simple database, inserts a couple records, and then queries those records. Sure it's the long way but also the fun way. :)
     
  3. phillipjfry thread starter macrumors 6502a

    phillipjfry

    Joined:
    Dec 12, 2006
    Location:
    Peace in Plainfield
    #3
    hehe, i am trying, I haven't learned far enough as to how to get php to query mysql for information :)
    Sometimes I ask for an easy way out because of frustration, this is one of those times :)


    Edit: Ok, I tried a small script that php tries to access mysql.

    I ran it and I got this error

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Users/username/Sites/test.php on line 2

    I don't have a mysql.sock file on my system anywhere, especially in /var/mysql/
    I've tried installing mysql all day today, using different sources each time (since i suspected it wasn't installing right). Thanks in advance :)

    Edit2: Ok it looks like I got everything setup the way it should be. I ended up just dumping the whole /usr/local/mysql folder, installing MAMP and fiddling with those config files (to get them to point to /User/username/Sites folder; and no, changing the DocumentRoot in the GUI settings does NOT work for some reason). Now I just have to learn how to code :p
     
  4. LBmtb macrumors newbie

    Joined:
    Mar 8, 2007
    Location:
    long bizzle, ca
    #4
    If you learn well from books, pick up Web Database Applications with PHP and MySQL, it's an O'Reilly book. It helped me tons.
     
  5. timmillwood macrumors 6502a

    Joined:
    Apr 7, 2006

Share This Page