Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1

    Default PHP 5.0 can't connect to MySQL dB


    Hi there guys!

    To all PHP & MySQL Experts... please help!

    Issue: My PHP can't connect to MySQL

    OS: WinXP Prof SP2
    Server: IIS
    PHP: version 5.0 (uses CGI)
    MySQL: version 5.0 (username: "root" & password: test)

    PHP Side:
    - I don't have any issues hard coding it or using it in DreamweaverMX
    - I just can't connect to MySQL weather hard coding or configuring in DreamweaverMX!

    MySQL Side:
    - I can do anything in creating & administering databases on the command line
    - This just don't want to cooperate with my PHP 5.0

    Troubleshooting:
    - Turn off all firewall/anti-virus/any software that's a possibility in blocking the connection

    Error Code: "PHP Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\PHPTest\test.php on line 7"

    My dB connection code:
    <?php
    $con = mysql_connect("localhost","root","secret");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }// some code
    ?>

    Standbye sa lang guys... Tnx daan ninyo!
    But for now, if you have something in mind please do feel free to post your suggestions in troubleshooting this. Thanks again!



    Be back...,
    ForYou

  2. #2

    Default Re: PHP 5.0 can't connect to MySQL dB

    Be sure na butang nimo ang libmySQL.dll sa imong system directory and remove nimo ang ; sa extension=php_mysql.dll sa php.ini file then restart your web server.


    btw here's a good link in installing php and mysql. http://vbforums.com/showthread.php?t=330825

  3. #3

    Default Re: PHP 5.0 can't connect to MySQL dB

    bai!
    unsaon man pag display database to vb example i want a month from may to june then mo display ang month sa may to june nga data from database.... other SQL i know kana ra .... unsaon man

    mag gamit man gud ko inventory para sa amo company I.T staff ko i want to help lang nila....

    pls..

  4. #4

    Default Re: PHP 5.0 can't connect to MySQL dB

    Quote Originally Posted by ventura
    bai!
    unsaon man pag display database to vb example i want a month from may to june then mo display ang month sa may to june nga data from database.... other SQL i know kana ra .... unsaon man

    mag gamit man gud ko inventory para sa amo company I.T staff ko i want to help lang nila....

    SQL:

    select trxid, mdate, description from table where mdate between date1 and date2

    pls..

  5. #5

    Default Re: PHP 5.0 can't connect to MySQL dB

    Guys!
    Still having issues connecting mySQL to PHP gyud... Other info/resources guys beh? Please do help... Tnx!
    By the way, unsa diay mysql.default_socket? Anyone guys?... Tnx again!...

  6. #6

    Default Re: PHP 5.0 can't connect to MySQL dB

    mag xammp nalng diay ka bai?... check daw onsa port imo gi gamit.

  7. #7

    Default Re: PHP 5.0 can't connect to MySQL dB

    i have the same promblem .... up!

  8. #8

    Default Re: PHP 5.0 can't connect to MySQL dB

    This is assuming nga ok na inyo MySQL ha... sigurado na gyud nga ga-dagan.

    I check ang mga port gigamit.

    Kung dili pa gali gyud, gamit na lang ug XAMMP or WAMP para wala na problema.

  9. #9

    Default Re: PHP 5.0 can't connect to MySQL dB

    Ay teka... Kani nga error code:
    Quote Originally Posted by ForYou
    Error Code: "PHP Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\PHPTest\test.php on line 7"
    indicates that there could be something wrong with your PHP configuration.

    Wala pa ta kabalo kung naa problema sa imo db connection coz wala pa man kaabot imo script didto. Look:
    My dB connection code:
    <?php
    $con = mysql_connect("localhost","root","secret");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }// some code
    ?>
    If the script proceeded, it could have given you the string 'Could not connect: ...' + the error you specified. But it got stuck with the mysql_connect function that is built-in php.

    So fix this first.

  10. #10

    Default Re: PHP 5.0 can't connect to MySQL dB

    Better check your php if properly configured ba.
    Create a php file, any filename blaha nka.
    <?php
    phpinfo();
    ?>
    e save din open imo browser, this will tell if na configure ba imong php with Mysql.
    Tanawa sa middle part man cguro kung naay configuration.

    E make sure lng sa php.ini na unmark ang mysql nga dll din nka define ang path sa php.ini or maayo i butang nimo cya sa root folder saimung windows

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. Connecting to MySQL Database
    By raybanz21 in forum Programming
    Replies: 8
    Last Post: 03-08-2009, 04:07 PM
  2. help can't connect to my wireless connection
    By nirdle_phogi in forum Networking & Internet
    Replies: 16
    Last Post: 01-18-2009, 12:53 PM
  3. Help me, my LAN can't connect to the NET
    By DeathFox in forum Networking & Internet
    Replies: 5
    Last Post: 07-24-2008, 04:01 PM
  4. HELP! Can't connect to the internet
    By scorpio1641 in forum Networking & Internet
    Replies: 10
    Last Post: 06-03-2008, 10:59 AM
  5. help!!!cant connect to mysql database...
    By ingkiang in forum Programming
    Replies: 4
    Last Post: 04-12-2008, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top