|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
$sql="SELECT free,other,url,image FROM userdb where 1 and webadv like "ON" and active like "YES"";
$sth = $dbh->prepare($sql); $rv = $sth->execute; @row=$sth->fetchrow_array(); print @row; # it's 1st record --------------------------------------- The result of $rv is 5, How to read the 3rd record ? ps. don't use "while((@row)=$sth->fetchrow)" |
|
#2
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rtna:
$sql="SELECT free,other,url,image FROM userdb where 1 and webadv like "ON" and active like "YES""; $sth = $dbh->prepare($sql); $rv = $sth->execute; @row=$sth->fetchrow_array(); print @row; # it's 1st record[/quote] And why not: ps. don't use "while((@row)=$sth->fetchrow)" Buy a book. page 131,132 of "Programming the Perl DBI" describe just how to do that. It is under the header "Batch Fetching". Good book worth the money. Peter |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > How to read a special ROW using DBI |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|