]> granicus.if.org Git - php/commitdiff
added new function int mysql_get_server_version
authorGeorg Richter <georg@php.net>
Thu, 13 Feb 2003 00:11:17 +0000 (00:11 +0000)
committerGeorg Richter <georg@php.net>
Thu, 13 Feb 2003 00:11:17 +0000 (00:11 +0000)
this function is available since libmysql change set 1.1450 (2002-02-13)

ext/mysqli/mysqli_api.c
ext/mysqli/mysqli_fe.c
ext/mysqli/php_mysqli.h

index 8efee2e66b711e23ed493e877d78fcb410ac5baf..dd10e38e5bcffb27064d3ef181642dae38e976e7 100644 (file)
@@ -948,6 +948,23 @@ PHP_FUNCTION(mysqli_get_server_info)
 
 /* }}} */
 
+/* {{{ proto int mysqli_get_server_version 
+*/
+PHP_FUNCTION(mysqli_get_server_version)
+{
+       MYSQL   *mysql;
+       zval    *mysql_link = NULL;
+
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+               return;
+       }
+       MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link"); 
+
+       RETURN_LONG(mysql_get_server_version(mysql));
+}
+
+/* }}} */
+
 /* {{{ proto string mysqli_info(resource link)
 */
 PHP_FUNCTION(mysqli_info)
index 7c4f524d04dc5a1444c6a9220c9b56579390870e..4d7651d9701cbdd504f3103568851cccd007687b 100644 (file)
@@ -73,6 +73,7 @@ function_entry mysqli_functions[] = {
        PHP_FE(mysqli_get_host_info,                                            NULL)
        PHP_FE(mysqli_get_proto_info,                                           NULL)
        PHP_FE(mysqli_get_server_info,                                          NULL)
+       PHP_FE(mysqli_get_server_version,                                       NULL)
        PHP_FE(mysqli_init,                                                             NULL)
        PHP_FE(mysqli_info,                                                                     NULL)
        PHP_FE(mysqli_insert_id,                                                        NULL)
@@ -141,6 +142,7 @@ function_entry mysqli_link_methods[] = {
        PHP_FALIAS(get_host_info,mysqli_get_host_info,NULL)
        PHP_FALIAS(get_proto_info,mysqli_get_proto_info,NULL)
        PHP_FALIAS(get_server_info,mysqli_get_server_info,NULL)
+       PHP_FALIAS(get_server_version,mysqli_get_server_version,NULL)
        PHP_FALIAS(init,mysqli_init,NULL)
        PHP_FALIAS(info,mysqli_info,NULL)
        PHP_FALIAS(insert_id,mysqli_insert_id,NULL)
index 9c4a0edd05a681f71a9906d22cea075996d5668e..01301f573d68f080c418e0ddd27b7290956c8b20 100644 (file)
@@ -179,6 +179,7 @@ PHP_FUNCTION(mysqli_get_client_info);
 PHP_FUNCTION(mysqli_get_host_info);
 PHP_FUNCTION(mysqli_get_proto_info);
 PHP_FUNCTION(mysqli_get_server_info);
+PHP_FUNCTION(mysqli_get_server_version);
 PHP_FUNCTION(mysqli_info);
 PHP_FUNCTION(mysqli_insert_id);
 PHP_FUNCTION(mysqli_init);