Basic Tutorial.
Nak dapatkan list sebegini kat dalam Ms-Excel.
1.
2.
3.
Taddaaaaa..
Basic PHP Table
Monday, August 11, 2008
<?php
$kira = 12;
?>
<table width="20%" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<?
for ($i=1; $i<$kira; $i++)
{
?>
<td><? echo $i; ?></td>
<?
if ($i%2 == 0)
{
echo "</tr><tr>";
}
}?>
</tr>
</table>
Posted by ayus at 9:01 PM 0 comments
Basic String Manipulation
$lotno = "NF218807-16"; //NF218807-16
$ext = substr(strrchr($lotno, "-"), 1); //16
$addzero = sprintf("%03d",$ext); //016
$lotdpn = substr($lotno, 0, strpos($lotno, "-")); //NF218807
Posted by ayus at 6:40 PM 0 comments
Labels: php, programming
Postgres Sorting Order By int8()
Thursday, August 07, 2008
Biasanya guna
select * from supdoc order by id;
hasil: id tetap tidak dapat disusun... mungkin sbb datatype
untuk mengatasi masalah ini, guna function int8()
ini utk postgres jer (kot)..
select * from supdoc order by int8(id);
hasil: ia tersusun dengan baik...
Posted by ayus at 2:58 AM 1 comments
Subscribe to:
Posts (Atom)