Déposer vos bouts de code en ligne. La validation est automatique, votre code source
apparaîtra instantanément sur le site.








Description du code source
Fonction simple qui retourne un tableau avec les differentes données de la dernière requête MySQL envoyée au serveur sous forme de chaine

| .01 .02 .03 .04 .05 .06 .07 .08 .09 .10 .11 .12 .13 .14 .15 .16 .17 .18 .19 .20 .21 .22 .23 .24 .25 .26 .27 |
<?php
function get_mysql_info($linkid = null){ $linkid? $strInfo = mysql_info($linkid) : $strInfo = mysql_info(); $return = array(); ereg("Records: ([0-9]*)", $strInfo, $records); ereg("Duplicates: ([0-9]*)", $strInfo, $dupes); ereg("Warnings: ([0-9]*)", $strInfo, $warnings); ereg("Deleted: ([0-9]*)", $strInfo, $deleted); ereg("Skipped: ([0-9]*)", $strInfo, $skipped); ereg("Rows matched: ([0-9]*)", $strInfo, $rows_matched); ereg("Changed: ([0-9]*)", $strInfo, $changed); $return['records'] = $records[1]; $return['duplicates'] = $dupes[1]; $return['warnings'] = $warnings[1]; $return['deleted'] = $deleted[1]; $return['skipped'] = $skipped[1]; $return['rows_matched'] = $rows_matched[1]; $return['changed'] = $changed[1]; return $return; } ?> |

array : Crée un tableau - (PHP 4, PHP 5)
ereg : Expression rationnelle standard - (PHP 4, PHP 5)
mysql_info : Lit des informations à propos de la dernière requête MySQL - (PHP 4 >= 4.3.0, PHP 5, PECL mysql:1.0)

Phpsources rémunère votre participation sur tous les dépôts de codes sources, d'applications, d'articles et vous gagnez les revenus à vie des pages générées ;)
» Inscription libre et gratuite