|
 |
|
แนะนำ SQL SUBSTRING หน่อยค่ะ SELECT SUBSTR(Name,0,2) As MySubStr FROM customer |
|
 |
|
|
 |
 |
|
ถ้าเป็น mysql อักษรตัวแรกจะเริ่ม นับ1 ไม่ใช่ 0
SUBSTR(Name,1,2) จะได้ 2 ตัวแรก
|
 |
 |
 |
 |
Date :
2009-12-20 20:13:12 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
function decodepassword($password) {
$passwordlen=strlen($password);
for ($i=0; $i<$passwordlen; $i++) {
$arr[$i]=substr($password,$i,1);
}
for ($j=0; $j<$passwordlen; $j++) {
$arr[$j]=ord($arr[$j]);
$arr[$j]=$arr[$j]+1; // decrease ascii value
$arr2[$j]=chr($arr[$j]);
}
$decodepassword ='';
for ($k=$passwordlen-1; $k>-1 ; $k--) {
$decodepassword=$decodepassword.$arr2[$k];
}
return $decodepassword ;
}
เขียนเป็น vb.net ได้ยังไงค่ะ
|
 |
 |
 |
 |
Date :
2010-01-07 14:44:02 |
By :
NIDA |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|