473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem to retrieve information from a mysql database

Hi!

I have a value loaded in a database as following:

<p><strong>test</strong></p>
<p><strong>test 2</
strong><em><strong>questions<img alt=""
src="http://www.mysite.com/fckeditor/edit...es/smiley/msn/
regular_smile.gif" /></strong></em></p>

when I retrieve the information in a web page using $row[pregunta]
(the above value is stored in the previuos variable) the value shown
is:

<p><strong>test</strong></p<p><strong>test 2</
strong><em><strong>questions<img alt="" src="http://www.mysite.com/
fckeditor/editor/images/smiley/msn/regular_smile.gif" /></strong></
em></p>

when actually what I need to show is the formates text using the HTML
tags.

Anyone can help me to solved why the string is shown with the HTML
tags and not formated'

Thanks!

Zek
Jun 27 '08 #1
2 2058
zek2005 wrote:
Hi!

I have a value loaded in a database as following:

&lt;p&gt;&lt;strong&gt;test&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;test 2&lt;/
strong&gt;&lt;em&gt;&lt;strong&gt;questions&lt;img alt=&quot;&quot;
src=&quot;http://www.mysite.com/fckeditor/edit...es/smiley/msn/
regular_smile.gif&quot; /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

when I retrieve the information in a web page using $row[pregunta]
(the above value is stored in the previuos variable) the value shown
is:

<p><strong>test</strong></p<p><strong>test 2</
strong><em><strong>questions<img alt="" src="http://www.mysite.com/
fckeditor/editor/images/smiley/msn/regular_smile.gif" /></strong></
em></p>

when actually what I need to show is the formates text using the HTML
tags.

Anyone can help me to solved why the string is shown with the HTML
tags and not formated'

Thanks!

Zek
This has nothing to do with PHP. It's how HTML works. &lt;p&gt; will
always display <p>. If you want a paragraph tag, you use a paragraph
tag: <p>. And so on. You can get more help on this in alt.html.

But why are you even storing html tags in your database. You should be
storing the data in a display-independent format and format the items
when you retrieve them. For more help on this end, see your favorite
database newsgroup.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 27 '08 #2
zek2005 wrote:
Hi!

I have a value loaded in a database as following:

&lt;p&gt;&lt;strong&gt;test&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;test 2&lt;/
strong&gt;&lt;em&gt;&lt;strong&gt;questions&lt;img alt=&quot;&quot;
src=&quot;http://www.mysite.com/fckeditor/edit...es/smiley/msn/
regular_smile.gif&quot; /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

when I retrieve the information in a web page using $row[pregunta]
(the above value is stored in the previuos variable) the value shown
is:

<p><strong>test</strong></p<p><strong>test 2</
strong><em><strong>questions<img alt="" src="http://www.mysite.com/
fckeditor/editor/images/smiley/msn/regular_smile.gif" /></strong></
em></p>

when actually what I need to show is the formates text using the HTML
tags.

Anyone can help me to solved why the string is shown with the HTML
tags and not formated'

Thanks!

Zek
You can try using htmlspecialchars(). This is usually used to prevent
html entities from displaying as html such as < >. But it may preserve
the the original markup when displayed in a browser.
If you can give a reason why you are using this particular data, there
may be a better way to accomplish what you want to do.

Scotty
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wayne Pierce | last post by:
I have a small script with PHP that queries a MySQL database to pull out one row, where I want to be able to access each of the columns separately. I have tried several different variations and am...
16
by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
2
by: tranky | last post by:
Hi.... .....i'd like to know if there's a way to write in a textbox the schema of a database. numbers of tables, tables name, numbers of fields, fields name and other information like fields...
3
by: JM | last post by:
Before storing information from a form in database I perform follwing operations on it : $path = mysql_real_escape_string(strip_tags(trim(urldecode($_POST)))); $summary =...
5
by: yoyoz | last post by:
Help!!!! i am newbie to php, i was trying to establish the connection to another machine (solaris) so that i can retrieve data from the database stored inside there using my own PC. for your...
1
by: hesameagle | last post by:
Hi I want to use ajax to connect to database and echo some data in my page, I wrote these two codes that can handle my need: index.php ----------------------------------------- <?php ...
7
by: Vio | last post by:
Hello everyone, i currently a beginner in php. I want to ask about Win2003 Active Directory users. Is it possible to retrieve Win2003 AD (just username & password) with php. I'm currenty...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.