lets say it in example,i had column, which its rows contain numbers increasing -10,-9,-8,-7,....-1, those rows got bugged and changed into 1,2,3,4,.....10,
that was example, the real one is over 40,000 rows, and it was -2147483629,-2147483630,-2147483631,....etc and it turned into 1000000001,1000000002,1000000003,....
how to make script that scan for 1000000001~1000000050 (for example) and make it change them into -2147483629~-2147483679 ?

This is my first try:

<?php
  $config = array(
    'db_username' => 'Dusername', // database username
    'db_password' => 'pass',   // database password
    'db_dsn'      => 'kal_db',   // system DSN to the database

    'debug'       => false,               // show SQL errors if true
);



        $conn = odbc_connect($config['db_dsn'],
                             $config['db_username'],
                             $config['db_password']);
 
  
  $iid = "SELECT
			IID
        FROM
            Item
		WHERE
			IID > 0";
  $iidcodes = odbc_exec($conn,$iid);
  while($r = odbc_fetch_array($iidcodes)){
	$iids = $r['IID'];
	$newiid = -500;
	$changesql = "	UPDATE	Item
							SET
								IID		=  '$newiid'
							WHERE
									IID = '$iids'
								";
	$donechanging = odbc_exec($conn,$changesql);
	$newiid++;
  }
  ?>

thanks solved without any help ^^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.