ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-france
php-france
[php-france] Trier un tableau selon plusieurs critères.
by David BOURIAUD other posts by this author
Jun 22 2007 2:33AM messages near this date
Re: [php-france] Heure locale. | Re: [php-france] Trier un tableau selon plusieurs critères.
Bonjour, 
me voici confront� � un probl�me que je n'avais jamais rencontr� auparavant, 
que je sais r�soudre en sql, mais pas du tout en php....
Voici la probl�matique :
Je r�cup�re des informations dans une base de donn�es. Au moment de la 
r�cup�ration, j'ajoute artificiellement une colonne � la ligne r�cup�r�e.
Le code ressemble un peu � �a :

while ($rSet = ifx_fetch_row (($resId, (int)$indexRes))
{
	$tab[$indexTab] = $rSet;
	$tab[$indexTab]['plop'] = $valeur;
	$indexRes++;
	$indexTab++;
}

Or, apr�s coup, je voudrais trier le tableau obtenu, $tab, selon plusieurs 
colonnes.
En l'ocurence, chaque ligne de $tab ressemble � 
col1 | col2 | col3 | col4 | col5 | plop

Je veux trier ce foutu tableau $tab, selon les colonnes col1, col2 et col5.
Quelqu'un aurait une id�e du comment faire ?
Merci pour toute aide ou suggestion.
Thread:
David BOURIAUD
Jean-Marie Fourcade
David BOURIAUD
Patrick
Benjamin APARICIO

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved