| @@ 1031-1037 (lines=7) @@ | ||
| 1028 | } |
|
| 1029 | // key inclues dans la requete |
|
| 1030 | $keys = array(); |
|
| 1031 | foreach(preg_split('/\)\s*,?/',$namedkeys) as $v) { |
|
| 1032 | if (preg_match("/^\s*([^(]*)\((.*)$/",$v,$r)) { |
|
| 1033 | $k = str_replace("`", '', trim($r[1])); |
|
| 1034 | $t = trim(strtolower(str_replace("`", '', $r[2])), '"'); |
|
| 1035 | if ($k && !isset($keys[$k])) $keys[$k] = $t; else $keys[] = $t; |
|
| 1036 | } |
|
| 1037 | } |
|
| 1038 | // sinon ajouter les key index |
|
| 1039 | $query = |
|
| 1040 | 'SELECT name,sql FROM' |
|
| @@ 818-824 (lines=7) @@ | ||
| 815 | } |
|
| 816 | $keys = array(); |
|
| 817 | ||
| 818 | foreach(preg_split('/\)\s*(,|$)/',$namedkeys) as $v) { |
|
| 819 | if (preg_match("/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/",$v,$r)) { |
|
| 820 | $k = str_replace("`", '', trim($r[1])); |
|
| 821 | $t = strtolower(str_replace("`", '', $r[2])); |
|
| 822 | if ($k && !isset($keys[$k])) $keys[$k] = $t; else $keys[] = $t; |
|
| 823 | } |
|
| 824 | } |
|
| 825 | spip_mysql_free($s); |
|
| 826 | return array('field' => $fields, 'key' => $keys); |
|
| 827 | } |
|