- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
include_once('library.php');
$query=mysql_fetch_row(mysql_query('SELECT MAX(id) FROM news'));
$max_id=$query[0];
//echo $max_id;
//$query=mysql_fetch_row(mysql_query('SELECT MIN(id) FROM news'));
$min_id=1;
do{
$query=mysql_fetch_row(mysql_query('SELECT id FROM news WHERE id='.$min_id.''));
$query=$query[0];
mysql_query('UPDATE news SET id='.++$query.' WHERE id='.$min_id.'');
echo $query;
}while($min_id++<$max_id);
Crazyzubr 03.08.2013 17:38 # +2
* Если закрыть глаза на все остальное...
inkanus-gray 03.08.2013 18:34 # 0
Lure Of Chaos 03.08.2013 22:41 # 0