mysql_connect

GD - August 13, 2005 - 22:57
Project:Drupal
Version:6.x-dev
Component:other
Category:feature request
Priority:critical
Assigned:Unassigned
Status:by design
Description

I am new to PHP so excuse me if I am wrong.

In current versions of mysql the mysql_connect function has been superceded with the function mysql_real_connect and therefor the Drupal connect functions need updating

#1

killes@www.drop.org - August 14, 2005 - 00:14
Status:active» by design

you are wrong. the function you are lookign for is mysqli_real_connect. Note the "i". mysqli is an alternative extension that allows people to access advanced features of mysql 4.1 which Drupal does not use.

#2

GD - August 14, 2005 - 06:08

24.2.3.5. mysql_connect()
MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd)

Description

This function is deprecated. It is preferable to use mysql_real_connect() instead.

mysql_connect() attempts to establish a connection to a MySQL database engine running on host. mysql_connect() must complete successfully before you can execute any of the other API functions, with the exception of mysql_get_client_info().

The meanings of the parameters are the same as for the corresponding parameters for mysql_real_connect() with the difference that the connection parameter may be NULL. In this case the C API allocates memory for the connection structure automatically and frees it when you call mysql_close(). The disadvantage of this approach is that you can't retrieve an error message if the connection fails. (To get error information from mysql_errno() or mysql_error(), you must provide a valid MYSQL pointer.)

#3

killes@www.drop.org - August 14, 2005 - 17:34

http://de3.php.net/mysql-connect

There is nothign mentioned ybout mysql_connect being depreciated. I guess you are quoting directly from the mysql docs. In any case: This doesn't afffect us now.

#4

greggles - February 22, 2006 - 05:05
Version:4.6.2» x.y.z
Category:bug report» feature request
Status:by design» postponed

So let's use it in the future...like 4.8

#5

bdragon - September 7, 2007 - 01:42
Version:x.y.z» 6.x-dev
Status:postponed» by design

The PHP function mysql_connect has nothing to do with the MySQL C API function mysql_connect.

 
 

Drupal is a registered trademark of Dries Buytaert.