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 7988417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:26:40+00:00 2026-06-04T12:26:40+00:00

i have a litte problem! i want to fetch the last 3 rows from

  • 0

i have a litte problem! i want to fetch the last 3 rows from my mysql database.. (works)

<?php
$sql = "SELECT id,title,description FROM news ORDER BY `id` DESC LIMIT 0, 3";
$result = mysql_query($sql);
while ($list = mysql_fetch_assoc($result)) 
{
?>
    <div class="one-of-three">
        <div class="box">
            <h2><?PHP echo ($list['id']);?> <?PHP echo (htmlentities($list['title'],ENT_QUOTES,'UTF-8'));?></h2>
            <div class="content clearfix">
                <p><?PHP echo (htmlentities($list['description'],ENT_QUOTES,'UTF-8'));?></p>
            </div>
        </div>
    </div>
<?php
}
?>

my problem is the html layout! i have 3 div boxes wich i will float..

    <div class="one-of-three">
        [...]
    </div>
    <div class="two-of-three">
        [...]
    </div>
    <div class="three-of-three">
        [...]
    </div>

but my result gives me

    <div class="one-of-three">
        [...]
    </div>
    <div class="one-of-three">
        [...]
    </div>
    <div class="one-of-three">
        [...]
    </div>

i tried different things but i dont how it works 🙁
you can give me a hint?

  • 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-06-04T12:26:42+00:00Added an answer on June 4, 2026 at 12:26 pm

    You should probably get an array $numbers = array('one', 'two', 'three');. Then have a variable $i = 0; and increment it in the loop. The first line should then be like: <div class="<?php echo $numbers[$i++]; ?>-of-three">.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a litte problem here. I want to join twice from the same
I have a little problem. I want to pass two variables from PHP to
I have a litte problem with a mysql query. I use 5 tables: user_has_data
I have a little problem, I have an array and I want to add
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,
I have a little problem. I want to use Helvetica Neue 75 Bold in
Well I have a little problem. I want to get the sum of all
I have a little problem with a regex. I want to find in my
I have a little problem with a navigation I'm making. I want my navigation
I have a little problem in my code. The variables don't want to change

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.