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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:06:25+00:00 2026-05-26T18:06:25+00:00

I want to modify my query results with css styles. For example my code

  • 0

I want to modify my query results with css styles.

For example my code is

<?php
      $sql=mysql_query("SELECT * FROM database")
      or die(mysql_error());   
    while($row = mysql_fetch_array( $sql )) {

    Print "$row[Number].$row[Email],$row[Username]<br>";

    }
?>

And i got a style with times new roman

<style type="text/css">
.Stylize {
    font-family: "Times New Roman", Times, serif;
}
</style>

How can I assign the Stylize CSS class to the print $row[Number] output?

  • 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-26T18:06:26+00:00Added an answer on May 26, 2026 at 6:06 pm

    the simplest way to do so is printing the style into the code easy for printing separated messages not related to the design of the page :

     Print "<span style='font-family:Times New Roman, Times, serif;'> $row[Number].$row[Email],$row[Username]</span>";
    

    other way is to add the CSS class name and add the CSS code in a separate tag useful if u are printing many things with common style so you can change the tag once rather than change all the messages
    css code :

    <style type="text/css">
    .Stylize {
        font-family: "Times New Roman", Times, serif;
    }
    </style>
    

    php code :

    <?php
          $sql=mysql_query("SELECT * FROM database")
          or die(mysql_error());   
        while($row = mysql_fetch_array( $sql )) {
    
        Print "<span class='Stylize'>$row[Number].$row[Email],$row[Username]<span>";
    
        }
    ?>
    

    very basic yet it’s a very useful best practice

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

Sidebar

Related Questions

I want to modify the code in this AJAX example to get results from
I have the SQL query: select title, scale / next_scale, c from ( select
I want to modify a query in my forum code, to return two fields
I have the following SQL query: SELECT DISTINCT ProductNumber, PageNumber FROM table I am
I want to modify some code in the Eclipse JDT itself (In the Debug
I want to modify a view from Action Helper in Zend Framework in preDispatch()
Whenever I want to modify a winform from another thread, I need to use
I have this query: SELECT p.text,se.name,s.sub_name,SUM((p.volume / (SELECT SUM(p.volume) FROM phrase p WHERE p.volume
Let's say I have the following query. SELECT ID, Email, ProductName, ProductModel FROM Products
Current query SELECT * FROM employee AS E INNER JOIN credential AS C ON

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.