#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    $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. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    16
    Rep Power
    0
    <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


IMN logo majestic logo threadwatch logo seochat tools logo