SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    karachi
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with PHP 5 with MySQL in mysql_connect

    My codes used to work fine with old php and mysql.
    I have the same version fo mysql but now after installing new php5

    The mysql_connect() says that it is invalid.
    I think the new php has no builtin support for mysql .
    I have searched net and found out that many people have faced it but i could not get a solid solution that can solve my problem

    Please in your replies. Be very precise and give good explanations of steps that i can follow with the setup files so that i can run MYSQL on PHP 5

    Thank You
    Regards
    Hearthrob

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    India
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can we know what error you got when the function got executed? Did it say something like that theres no such function like mysql_connect() ?
    If thats the case, you didn't enable the extensions php_mysql.dll and lib_mysql.dll properly.

    Go through : http://in.php.net/mysql
    for more details .

    Also I am not sure whether you use a windows or a linux system.Hope the above link helps you. If not,please give us the exact error that was thrown by the php error handler, and your OS.

    Regards,
    Celia

  3. #3
    SitePoint Guru dbevfat's Avatar
    Join Date
    Dec 2004
    Location
    ljubljana, slovenia
    Posts
    684
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe you have to enable the mysql.dll (windows) or mysql.so (linux) extension in your php.ini. Just search the file for text "extension=mysql" and delete the ";" in front of it. But be careful, if you are using mysql 4.1+, you have to use "mysqli", otherwise "mysql"

    Regards

  4. #4
    SitePoint Zealot ceefour's Avatar
    Join Date
    Feb 2005
    Location
    Bandung, Indonesia
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, PHP 5 has no mysql support built in. But if you're using any binary version of PHP the extension is supplied.
    All you need to do is add a:
    extension=mysql.so

    in your php.ini ..... I could be wrong with the filename so check your php/modules directory.

    If you're using Windows... errr maybe it's built in? Anyways check for 'extension=php_mysql.dll' in php.ini and uncomment it if it's there.


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
  •