View Single Post
Old 09-03-2004, 05:31 PM  
hive
Worker Bee
 
Join Date: Apr 2003
Posts: 90
Here. I will make this easy for you.

http://cvs.sourceforge.jp/cgi-bin/vi...viewcvs-markup

That is the source code to the mysql extension.

Here is the function to take note of, it sets the variables you see in the mysql section when you call phpinfo().

PHP_MINFO_FUNCTION(mysql)
{
char buf[32];

php_info_print_table_start();
php_info_print_table_header(2, "MySQL Support", "enabled");
sprintf(buf, "%ld", MySG(num_persistent));
php_info_print_table_row(2, "Active Persistent Links", buf);
sprintf(buf, "%ld", MySG(num_links));
php_info_print_table_row(2, "Active Links", buf);
php_info_print_table_row(2, "Client API version", mysql_get_client_info());
#if !defined (PHP_WIN32) && !defined (NETWARE)
php_info_print_table_row(2, "MYSQL_MODULE_TYPE", PHP_MYSQL_TYPE);
php_info_print_table_row(2, "MYSQL_SOCKET", MYSQL_UNIX_ADDR);
php_info_print_table_row(2, "MYSQL_INCLUDE", PHP_MYSQL_INCLUDE);
php_info_print_table_row(2, "MYSQL_LIBS", PHP_MYSQL_LIBS);
#endif

php_info_print_table_end();

DISPLAY_INI_ENTRIES();

}

This line here:
sprintf(buf, "%ld", MySG(num_links));
sets the value of 'buf' to the value of MySG(num_links)

This line here:
php_info_print_table_row(2, "Active Links", buf);
Is the value you see in phpinfo() for "Active Links".

in the function 'php_mysql_do_connect' MySG(num_links) is INcremented.
And in the function '_close_mysql_link' MySG(num_links) is DEcremented.
hive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote