Re: PHP not supporting MySQL



Siegfreed wrote:
My PHP version is obviously not compiled with MySQL support, consequently I get the following message:-

Fatal error: Call to undefined function mysql_connect() in C:\http-dir\board\connect.php on line 3

Question:- How do I instruct PHP to support MySQL?

Please note:-

extension=php_mysql.dll
extension=php_pdo_mysql.dll

in php.ini are enabled, and php.ini is located in the php root directory.

Thank you.

First of all, there's no need to change the registry if you have your php.ini file in the right place.

Secondly, there are three extensions you could be interested in.

extension=php_mysql.dll // (older) mysql_xxx interface
extension=php_mysqli.dll // (newer) mysqli_xxx objects
extension=php_pdo_mysql.dll // (newest) PDO interface for MySQL
extension=php_pdo.dll // also required for PDO

(note: the last, PHP Data Objects, is an abstraction layer for data access. It's relatively new, so you probably won't see much existing code using it.

Most sites use the mysql_xxx interface, while there are some going to the mysqli_interface.

And the interfaces are quite compatible - you can load all three and pick whichever one you want to use in your code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Classes vs functions
    ... Interfaces were Java's "solution" to multiple inheritance. ... in a way that one class may implement one or more interface. ... PHP; nobody would be obligated to use or abuse it. ... > resource-consuming) to be able to include an entire package. ...
    (comp.lang.php)
  • Re: Object Oriented Content System - the idea
    ... Would probably be difficult to enforce this militant style in PHP. ... (It's java, but you probably don't have to know java to see what's going ... The advantage of keeping them private or protected has been to prevent using ... way of private inner class and interface) In PHP this typically means another ...
    (comp.lang.php)
  • Re: PHP Scripts in an ASP Page
    ... what you do not realize is that two script language systems aren't ... ASP has the ability to use configurable script language engines like ... interface to abstract language specifics from the web execution context ... limitation in PHP. ...
    (microsoft.public.inetserver.iis)
  • Re: One class per file
    ... I think it is a good idea to put each single class (or interface) in a separate file. ... OS and PHP handle that many with acceptable performance so I need not worry about it? ... echo 'A'; ... None of these tests mean anything, especially on a shared server. ...
    (comp.lang.php)
  • Re: php 5 classes: public, protected and private
    ... Private members can be accessed by members of the class only. ... I'm trying to make a bit of sense of the php 5 ... the great Tony Marston is back to trolling again. ... the interface is the way to interact with the ...
    (comp.lang.php)