hello,
I have two tables.
a-master table
sno int
name varchar
..
..
b-detail table
sno2 int
sayac int
tarih date
..
..
master and detail table relating with sno and sno2
my problem is
when new record, must sayac value is count(sno2)+1 from detail table.
before record event is
$str = "select count(sno2) from detail where sno2 = '{$values["sno"]}'";
$rs = db_query($str,$conn);
$data = db_fetch_numarray($rs);
echo $data[0];
$values["sayac"]=$data[0]+1;
but I have 0 value in sayac.
what is problem this code?
thnx.