note 106044 added to function.mysql-info

From: Date: Wed, 05 Oct 2011 15:39:46 +0000
Subject: note 106044 added to function.mysql-info
Groups: php.notes 
Request: Send a blank email to php-notes+get-183645@lists.php.net to get a copy of this message
Hi, the Eric's function was nice for some test so i updated it to get no more DEPRECATED warning concerning ereg. Surely not perfect but functional. function get_mysql_info($linkid = null){ $linkid? $strInfo = mysql_info($linkid) : $strInfo = mysql_info(); $return = array(); preg_match("/(Records): ([0-9]*)/", $strInfo, $records); preg_match("/(Duplicates): ([0-9]*)/", $strInfo, $dupes); preg_match("/(Warnings): ([0-9]*)/", $strInfo, $warnings); preg_match("/(Deleted): ([0-9]*)/", $strInfo, $deleted); preg_match("/(Skipped): ([0-9]*)/", $strInfo, $skipped); preg_match("/(Rows matched): ([0-9]*)/", $strInfo, $rows_matched); preg_match("/(Changed): ([0-9]*)/", $strInfo, $changed); $return['records'] = isset($records['2']) ? $records['2'] : NULL; $return['duplicates'] = isset($dupes['2']) ? $dupes['2'] : NULL; $return['warnings'] = isset($warnings['2']) ? $warnings['2'] : NULL; $return['deleted'] = isset($deleted['2']) ? $deleted['2'] : NULL; $return['skipped'] = isset($skipped['2']) ? $skipped['2'] : NULL; $return['rows_matched'] = isset($rows_matched['2']) ? $rows_matched['2'] : NULL; $return['changed'] = isset($changed['2']) ? $changed['2'] : NULL; return $return; } ---- Server IP: 69.147.83.197 Probable Submitter: 217.167.131.45 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-info.php Edit -- https://master.php.net/note/edit/106044 Del: integrated -- https://master.php.net/note/delete/106044/integrated Del: useless -- https://master.php.net/note/delete/106044/useless Del: bad code -- https://master.php.net/note/delete/106044/bad+code Del: spam -- https://master.php.net/note/delete/106044/spam Del: non-english -- https://master.php.net/note/delete/106044/non-english Del: in docs -- https://master.php.net/note/delete/106044/in+docs Del: other reasons-- https://master.php.net/note/delete/106044 Reject -- https://master.php.net/note/reject/106044 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#183645) next »