Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7053835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:33:11+00:00 2026-05-28T03:33:11+00:00

rowI’m new at zend, so please be patient :). I need to extract only

  • 0

rowI’m new at zend, so please be patient :).

I need to extract only 5 results from a mysql query, how can I do this loop to work?, I’ll try to explain myself:

$var = $db->query($sql);
while($rows = $var->fetch()) {
$msg = 'loop from 1 to 5';
}
return $this->view->msg = $msg;

Hope you guys understand my issue, I know already the sentences are not correct written, but making myself understandable, please help

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:33:12+00:00Added an answer on May 28, 2026 at 3:33 am

    Maybe something like this might help get you on your way?

    $var = $db->query($sql);
    for($i = 0; $i<5; $i++) {
       $row = $var->fetch()) {
       $msg = 'loop from 1 to 5';
    }
    return $this->view->msg = $msg;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to delete a row from my JQGrid because I can't figure
I need to copy a row . Copied row,I need to change value, this
For each row I have a column which contains numbers like this 1,4,6,3,16,13 .
If I have a DataTable and want to create a new row I first
I need to Get the Entire Row values when I click on jquery grid
BGREX.BGREXDataTable _bRexDataTable = new BGREX.BGREXDataTable(); BGREX.BGREXRow bgRexRow = _bRexDataTable.NewBGREXRow(); bgRexRow.BGRes_TITLE = abc; bgRexRow.BGRes_VERSION =
I need to update each row of a table with one column as sum
I have this code foreach (DataRow row in dt.Rows) { Debug.WriteLine(Start of Row); for
In my mysql table on the same row i have a persons name, value1,
I'd like to get some rows ( z:row rows) from XML using: <rs:data> <z:row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.