I noticed that Message-ID:
<ca**************************@posting.google.com > from Michael contained
the following:
odbc_fetch_row($rs, $row);
$num=odbc_num_rows($rs);
for ($col=1;$col<$num+1;$col++) {
echo odbc_result($rs, $col);
echo " ";
}
Acutally I only get one row....Thanks indeed.
Regards Michael
That's because odbc_num_rows may not work properly with Select
statements. Crazy, huh?
See
http://uk2.php.net/manual/en/function.odbc-num-rows.php
Here's what I use
$odbc=odbc_connect ('data_source_name', '', '') or die( "Could Not
Connect to ODBC Database!" );
$sql="SELECT * from table";
$result=odbc_exec($odbc,$sql);
while($myrow=odbc_fetch_array($result)){
print "Field1 = ".$myrow['field1']."<br>";
print "Field2 = ".$myrow['field2']."<br>";
print "Fieldn = ".$myrow['fieldn']."<br>";
}
Hope this helps. If you need the number of rows just stick a counter in
the loop.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs
http://www.ckdog.co.uk/rfdmaker/