Tuesday, January 18, 2005

:: PHP :: MYSQL QUERY:TIME ::


DATE_ADD(cst_date, INTERVAL 7 DAY) - CURDATE()) <=7 AND (DATE_ADD(cst_date, INTERVAL 7 DAY) - CURDATE()) >= 0

mysql checking utk list kan tarikh 7 hari dr tarikh tersebut

huh berpeluh jugak.. nk buat checking simple nih...

Sunday, January 16, 2005

::PHP Class ::

dlm php 5 and php 4 ader satu special class dier call Constructor

- Constructor nie dier auto define/auto execute class

dlm PHP 5 :

__construct()


dlm PHP 4 :

function xxx() <-- namer dier mesti same dengan namer class

nie juse short noter.. note best dari mr vikram..
saper tak paham OOP .. leh jadi paham klu bacernote
dier

PHP 101 (part 7): The Bear Necessities

Sunday, January 09, 2005

::PHP : A-Z Link Generator ::

1) guner ascii key table
2) amik kat zend nyer site
A-Z


for ($i=65;$i<91;$i++) href="%s?letter=%s">%s ', $PHP_SELF, chr($i), chr($i));
}

function chr() nie akan list kan ascii character.. based on thier number

ascii table site

Wednesday, January 05, 2005

::PHP : Continue and Break (Basic) ::

Saper pernah belajar structured programming bender nie pun mmg berguner kat php..

continue......

tugas dier akan stop the loop pas tuh sambung balik klu value dier..
samer ngan condition di beri .. X paham e.g

while (list ($key, $value) = each ($arr)) {
if (!($key % 2)) { // skip odd members
continue;
}
do_something_odd ($value);
}

break
........

loop akan stop jiker meet the condition.. terus berhenti..
dier kuar dr loop Xpaham.. e.g

$arr = array ('one', 'two', 'three', 'four', 'stop', 'five');
while (list (, $val) = each ($arr)) {
if ($val == 'stop') {
break; /* You could also write 'break 1;' here. */
}
echo "$val
\n";
}

nombor lima takkan kuar...