mon select est :
SELECT WO_NUM, TASK, TYPE, STATUS ,'DETAIL.PHP?NUM=' + CAST( WO_NUM AS CHAR ) FROM TASKS WHERE TYPE IS NOT NULL AND STATUS <> 'TERMINÉ' ORDER BY WO_NUM DESC
j'ai rajouté les caracteres manquants:
preg_match_all('/(?:SELECT)\s([a-z0-9_\'\?\+\.\=\(\)]+)?\s?(?:ORDER BY\s)`?([a-z0-9_]*\s?)/i', $msSQL, $matches, PREG_SET_ORDER);
mais ca ne va pas..
la solution de maxoo me donne tjrs :
Parse error: parse error, expecting `')'' in h:\easyphp1-8\www\tfe\OO\msmaster.inc on line 16
l'adaptation qui me donne le resultat le plus proche est :
preg_match_all('/(ORDER BY)\s+?([a-z0-9_]*\s?)/i',$msSQL,$resultat);
foreach($resultat as $brol) foreach( $brol as $r)echo $r."<br />";
elle m'affiche:
ORDER BY WO_NUM
ORDER BY
WO_NUM
le DESC manque...
Partager