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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:23:22+00:00 2026-05-24T01:23:22+00:00

i have a question in regards to php and css layers. i have the

  • 0

i have a question in regards to php and css layers.

i have the following php code:

session_start(); 
// Retrieve all the data from the table
$SQL = "SELECT * FROM Exodus_planets WHERE login_id = $user[login_id] LIMIT 10";
$result = mysql_query($SQL);

//while ($db_field = mysql_fetch_assoc($result)) {
//print $db_field['planet_name'] . "<BR>";
//print $db_field['location'] . "<BR>";
while($row = mysql_fetch_array( $result )){
    echo " Planet,   ".$row['planet_name'];
    echo " is located at System  ".$row['location'];
    echo "<br> ";
}

which correctly displays a word [Planet name] and a number [System] in sequence.

The above code displays the information in rows such as;

Planet Sun is located in system 35.
Planet Saturn is located in system 30.
i’m just trying to make this information display a look a little nicer. in a way so planet name shows up in the right of a background image container and system in another corner possibly colored.
….

How do i place the above code inside floating css container(s)?

Thank you.

  • 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-24T01:23:23+00:00Added an answer on May 24, 2026 at 1:23 am

    As it seems to be a list of planets, I would use an HTML list. You can edit the css to have it look the way you want after.

    echo ' <ul class="planetList"> ';
    while($row = mysql_fetch_array( $result )){
        echo '<li>';
        echo " Planet,   ".$row['planet_name'];
        echo " is located at System  ".$row['location'];
        echo '</li> ';
    }
    echo '</ul>';
    

    In CSS

    ul.planetList {
       display:block;
       float:right;
       background-image:url('yourBackground.jpg');
       background-position:left;  
       background-repeat:repeat-y;
       /* CSS 3 Only */
       background-size:{length of your text}px 100%;
    }
    

    You could also use a table instead of the list. This way, you could get a background for the planet column, and another one for the located at sytem one.

    echo ' <table> ';
    echo ' <tr><th>Planet</th><th>System</th></tr>';
    while($row = mysql_fetch_array( $result )){
        echo '<tr>';
        echo '<td class="planet">' . $row['planet_name'] . '</td>';
        echo '<td class="system">' . $row['location']    . '</td>';
        echo '</tr> ';
    }
    echo '</table>';
    

    CSS :

    table>tr.planet {
       background-image:url('yourBackground.jpg');
       background-position:left;  
    }
    table>tr.system {
       background-color:#CCFF00;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, this question is in regards to PHP and MySQL I have
I have got a question with regards to upgrading asp.net mvc applications from v1
We have a question with regards to XML-sig and need detail about the optional
I have just asked this question an hour ago but with regards to IE8
I have a question in regard to PHP arrays. If I create an array
I'm quite new to PHP OOP and I have a question regarding a simple
In the following code, what can be called instead of ->getFilename() ? <?php foreach
My question regards relative and absolute addresses. I have over the years built a
I have a question regarding database connection in PHP and MySQL. I wonder if
I have few question in this regard When you create an internet page, does

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.