1<?PHP2 3 $serverName= "localhost";//Database server address4 5 $uid= "SA";//Database user name6 7 $pwd= "hwwlovejsy1314";//Database Password8 9 $connectionInfo=Array("UID" =$uid, "PWD" =$pwd, "Database" = "Locationanalysisdatabase");Ten One $conn= Sqlsrv_connect ($serverName,$connectionInfo); A - if($conn==false){ - the Echo"Connection Failed! "; - - die(Print_r(Sqlsrv_errors (),true)); } - + //Execute SQL statement with result set - + $query= Sqlsrv_query ($conn, "SELECT * from User_timeline_new"); A at $count= 1;//use the Count variable to control the number of changes per change - - while($row= Sqlsrv_fetch_array ($query)) - - { - in if($count<=274245) - to{sqlsrv_query ($conn, "update user_timeline_new set time = '".Strtotime($row[' Time ']). "' where uid = ' ".$row[' UID ']. "' and time = ' ".$row[' Time ']. "'"); + - $count++; the *}Else{ Break; } $ Panax Notoginseng}?> -
The main problem with this program is that it takes too long to run, and often encounters: Maximum execution time of the seconds exceeded issue, this just modifies php.ini in Max_execution_time
Increase the value later, and then restart the Apache service, OK.
Just started with sqlsrv directly modify the table in the SqlServer2008, inefficient, and then try to use the MySQL database, found the same low efficiency. White Busy day.