This topic is locked

get value from table with depend on dropdown value when add form

1/24/2011 9:29:52 PM
PHPRunner General questions
I
iyan.dk author

Dear all
Im newbie to phprunner,
I have table number and kode for tax :
no_urut no_kode

00000001 KUM

00000002 KUM

00000001 DK

00000002 DK

00000003 DK

00000004 DK

00000001 IP
no_kode is combo box
I just success with simple SQL with no "where clause",
$str = "SELECT max(no_urut)+1 from nofaktur";

$rs = db_query($str,$conn);

$data = db_fetch_numarray($rs);

$sesinourut = "0000000" . $data[0];

$dipangkas = substr($sesinourut, -8);

unset($_SESSION["no_urut"]);

$_SESSION["no_urut"] = $dipangkas;
but, this code too simple and not depend on no_kode,
how the sql code and onload event if I want no_urut value depend on no_kode

if I choose :
no_kode = "DK", no_urut will show value "00000005" on add form

no_kode = "KUM", no_urut will show value "00000003" on add form
need advise

regards

IYAN

I
iyan.dk author 1/28/2011

helo .. need help please