note 77688 added to function.mysql-connect

From: Date: Sat, 08 Sep 2007 21:43:15 +0000
Subject: note 77688 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-130320@lists.php.net to get a copy of this message
I needed a method to list open mysql connection and I found a trick that might work! If the coder saves the mysql link value to a variable it can be found and used with get_resource_type! I wrote a function that scans through GLOBALS (in depth if you need) and finds assigned mysql links. Go to : http://www.tellinya.com/art2/102/list-mysql-links and get the code plus some explanations. Hope it helps someone as it is the only way I found to do this without using mysql_* functions which attempt re-connect anytime used when connections not found. That's not cool! PS: if you have a better idea which does not try to establish a connection if not found I look forward to comments. Thanks! ---- Server IP: 69.147.83.197 Probable Submitter: 86.121.18.246 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- https://master.php.net/note/edit/77688 Del: integrated -- https://master.php.net/note/delete/77688/integrated Del: useless -- https://master.php.net/note/delete/77688/useless Del: bad code -- https://master.php.net/note/delete/77688/bad+code Del: spam -- https://master.php.net/note/delete/77688/spam Del: non-english -- https://master.php.net/note/delete/77688/non-english Del: in docs -- https://master.php.net/note/delete/77688/in+docs Del: other reasons-- https://master.php.net/note/delete/77688 Reject -- https://master.php.net/note/reject/77688 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130320) next »