By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

dbi

P: 36
hi all

i am trying to retrive the data from the database by using the following code and printing.But it is reteriving one entry less from the database.could some throw light on this.
Expand|Select|Wrap|Line Numbers
  1. my $sth = $dbh->prepare($query);
  2.     $sth->execute;
  3.  
  4.     while(my $ref = $sth->fetchrow_hashref())
  5.     {
  6.         print "Found a row: name = $ref->{'employee'}, Model = $ref->{'model'},Mac = $ref->{'mac'}<br>";
  7.     }
  8.  
Thnaking you in advance
Jul 9 '08 #1
Share this Question
Share on Google+
1 Reply


nithinpes
Expert 100+
P: 410
What is the query that you are passing? If you can post the string assigned to $query in your script, it would help to find out the cause.
Jul 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.