echo bold tag from database don't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

echo bold tag from database don't work

Post by ljCharlie »

I have a bunch of texts store in MySQL database. When I echo a field that has the tag "<strong></strong>, the texts is not bold. Here's what I tried.

Code: Select all

$var = '<STRONG>**</STRONG>Click <A href="eScholar.shtml">e-Scholar</A> for further information';
 
echo $var;
Now, the two ** are not bold. How do I fix this?

Thanks!
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

use <b></b> not <strong></strong>
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post by ljCharlie »

Thank you for the response. No, using <b></b> doesn't show up as bold either. Even if it works, it will not work in my case because the program that I use to allow users to type in their texts will automatically put in <strong></strong> into the database field.

I think the problem here is not what tag I use but how I echo it out and I'm not sure what work around there is to have this work in my case.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

something else must be wrong as that should work just fine.

paste all of your code in here so we can have a better look.

edit:

try putting your <strong> around somethign else besides your astericks...my guess is that you're just not seeing the difference in those chars.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

i think the same as burrito, change ** to test and then you will be able to tell if its bold or not.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

*cough*
Look at your HTML source

*cough*

;)
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post by ljCharlie »

Thank you for the help. Okay, I see it now. I got it.

Thanks!
Post Reply