]> granicus.if.org Git - php/commitdiff
Make it possible to specify both a port and a socket in mysql_[p]connect
authorRasmus Lerdorf <rasmus@php.net>
Mon, 20 Mar 2000 07:40:56 +0000 (07:40 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Mon, 20 Mar 2000 07:40:56 +0000 (07:40 +0000)
@ Make it possible to specify both a port and a socket in mysql_[p]connect

ext/mysql/php_mysql.c

index e9af97760ecb20e93bd143717d8ff375c1e4bc78..ffcc722f9bf127b55073c90b4d19c03cd597f135 100644 (file)
@@ -400,6 +400,11 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
                tmp++;
                if (tmp[0] != '/') {
                        port = atoi(tmp);
+                       if(tmp=strchr(tmp,':')) {
+                               *tmp=0;
+                               tmp++;
+                               socket=tmp;
+                       } 
                } else {
                        socket = tmp;
                }