#138319 - 2005-04-21 05:23 PM
Re: Quick Question: Which UDF do I use to query a DB that returns an array
|
thepip3r
Hey THIS is FUN
   
Registered: 2005-03-02
Posts: 350
|
using this code, I was able to get the results to print to the screen but count() isn't working. Can anyone give me any direction as to what I'm doing wrong?
Code:
$sql = "SELECT compid FROM computers WHERE Name='$HostName' AND MACAddress='$MAC'" $retcode = DBGetRecordSet($objConn,$sql) $datediff = $UnixDate - $UnixMonth
? $retcode for $i=0 to ubound($retcode,1) for $x=0 to ubound($retcode,2) $test = $retcode[$i,$x] ? $test next next
Eventually what I want to do is be able to count the results of the query and then perform another database transaction based off of the value of that number. Can anyone provide any direction?
|
|
Top
|
|
|
|
#138320 - 2005-04-21 05:28 PM
Re: Quick Question: Which UDF do I use to query a DB that returns an array
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Code:
ubound($retcode,1)
...is the size of the sub-array, and therefore the number of results in the set.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|