| @@ 679-685 (lines=7) @@ | ||
| 676 | } |
|
| 677 | $keys = array(); |
|
| 678 | ||
| 679 | foreach(preg_split('/\)\s*(,|$)/',$namedkeys) as $v) { |
|
| 680 | if (preg_match("/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/",$v,$r)) { |
|
| 681 | $k = str_replace("`", '', trim($r[1])); |
|
| 682 | $t = strtolower(str_replace("`", '', $r[2])); |
|
| 683 | if ($k && !isset($keys[$k])) $keys[$k] = $t; else $keys[] = $t; |
|
| 684 | } |
|
| 685 | } |
|
| 686 | spip_mysql_free($s); |
|
| 687 | return array('field' => $fields, 'key' => $keys); |
|
| 688 | } |
|
| @@ 1285-1291 (lines=7) @@ | ||
| 1282 | } |
|
| 1283 | } |
|
| 1284 | // key inclues dans la requete |
|
| 1285 | foreach(preg_split('/\)\s*(,|$)/',$namedkeys) as $v) { |
|
| 1286 | if (preg_match("/^\s*([^(]*)\(([^(]*(\(\d+\))?)$/",$v,$r)) { |
|
| 1287 | $k = str_replace("`", '', trim($r[1])); |
|
| 1288 | $t = trim(strtolower(str_replace("`", '', $r[2])), '"'); |
|
| 1289 | if ($k && !isset($keys[$k])) $keys[$k] = $t; else $keys[] = $t; |
|
| 1290 | } |
|
| 1291 | } |
|
| 1292 | // sinon ajouter les key index |
|
| 1293 | $query = |
|
| 1294 | 'SELECT name,sql FROM' |
|