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

  • Home
  • SEARCH
  • 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 7404011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:11:38+00:00 2026-05-29T05:11:38+00:00

under the while loop I have an ordered list it return the list with

  • 0

under the while loop I have an ordered list it return the list with the same number of the first item

this is my php code

<?php
  $all_tutorials = " select * from tutorials where active = 1";
  $result = $db -> query ($all_tutorials) or die ($db->error);
    if ($result) {
        while ($row = $result -> fetch_object()) {
    ?>

  <ol>
  <li><?php echo $row->tutorial_title ?></li>
  </ol>

  <?php 
        }
    }
  ?>

it returns the items some thing like this

1 blah blah blah blah blah blah ,
1 blah blah blah blah blah blah ,
1 blah blah blah blah blah blah ,

which it should be something like this

  1. blah blah blah blah blah blah
  2. blah blah blah blah blah blah
  3. blah blah blah blah blah blah

please someone tell me how to do this under the loop

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-29T05:11:39+00:00Added an answer on May 29, 2026 at 5:11 am

    Set the <ol> tags on the outside of the while.

    <?php
    $all_tutorials = " select * from tutorials where active = 1";
    $result = $db -> query ($all_tutorials) or die ($db->error);
    if ($result) {
        ?>
        <ol>
        <?php
        while ($row = $result -> fetch_object()) {
        ?>
    
        <li><?php echo $row->tutorial_title; ?></li>
    
        <?php 
        }
        ?>
        </ol>
        <?php
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this loop: <?php while (have_posts()) : the_post(); ?> <li><h2 class=titles><a href=<?php the_permalink()
In a while loop I have: $row = mysql_fetch_array($result) Held under $row are two
I am executing this statement under while (($data=fgetcsv($this->fin,5000,;))!==FALSE) Now what I want in else
I have been under the assumption for a while that viewDidUnload is always called
I have a program that has this code : #include<stdio.h> main(){ int input; char
I have a do...while loop and a try...catch block that wraps around database centric
In the below code there's a loop that features all products under a given
I'm continually getting the following error under Eclipse Galileo while trying to install the
While Ctrl X works fine in vim under windows, Ctrl A selects all (duh).
While attempting to get an old svn dump of a project under git control,

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.