Created
January 29, 2020 03:47
-
-
Save nimdasx/9982fb4606d111f2a80022e95b508760 to your computer and use it in GitHub Desktop.
nambahi nol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
mysql_connect('localhost','root',''); | |
mysql_select_db('xxx'); | |
$query = mysql_query("select * from lk_isi"); | |
while( $row = mysql_fetch_assoc($query) ){ | |
$bener = array(); | |
$tmp = explode('.',$row['HIRARKI']); | |
foreach( $tmp as $iva ){ | |
if( strlen($iva) < 2 ){ | |
$bener[] = str_pad($iva,2,'0',STR_PAD_LEFT); | |
}else{ | |
$bener[] = $iva; | |
} | |
} | |
$imp = implode('.',$bener); | |
//echo "update lk_isi set HIRARKI = '$imp' where ISI_ID = '".$row['ISI_ID']."'; <br/>"; | |
mysql_query("update lk_isi set HIRARKI = '$imp' where ISI_ID = '".$row['ISI_ID']."'"); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment