Martoni wrote:[color=blue]
> function Count_licenses($sID)
> {
> global $adb,$bgcl,$bgcd, $free;
> $query = "SELECT * FROM software_licenses WHERE (sID = '$sID')";
> $sth = $adb->prepare($query);
> if($sth)
> {
> $res = $sth->execute();
> $numRows = $sth->rows();
> $record = $sth->fetchrow_hash();
> $free = $record[free];
> if($free = "No" || $free = ""){[/color]
Uh Oh!
assignment, not comparison ... what do you expect the contents of $free
to be after this statement?
[color=blue]
> $total_entitlement=0;
> for ($i=0;$i<$numRows;$i++) {
> $record = $sth->fetchrow_hash();[/color]
Uh Oh!
read a second row and disregard the first?
It doesn't seem a good idea, especially when the second row is empty and
you don't test it.
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :