Jump to content


Formatting / PHP variables -> html

  • Please log in to reply
1 reply to this topic

#1 Jfkf14

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 23 May 2006 - 08:40 PM

Hello. I am querying a MySQL database with PHP and I need to display the output in a browser. I would like to format the output in a nice looking table, or at least even columns (each cell has a different length, so there aren't easily discernable columns). Is there a way to make some type of table in PHP, or is there a way to port variables from PHP to html (like a reverse $_POST). Is there any other way to do pretty formatting with output from MySQL?

Thank you.

#2 AndyB

  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 23 May 2006 - 09:23 PM

You can't make a table with php. What you can do is echo a series of html statements. 'Pretty format' it exactly the same way as you would any other text - use html tags. The dot is the string concatenation operator that lets you add stuff to a string ... simple example:
echo "<bold>". $some_variable. "</bold>";

Legend has it that reading the manual never killed anyone.
My site

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users