469,331 Members | 1,879 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

Html In The Database??

Chrisjc
375 256MB
I was told the other day that I was able to place HTML in my database.. So I thought to my self that be grate for my feature points so I can use bullets... so I put the following code in one of my COL's just to see if it work here is the following code.

[HTML]<ul>
<li>Pro-GUARD 7 high flow, high efficiency filter media air filter</li>
<li>Increases horsepower up to 100 HP depending on application</li>
<li>Improves torque up to 112 lbs/ft depending on application</li>
<li>Maximizes airflow for better acceleration and responsiveness</li>
<li>Improved performance results in greater fuel efficiency</li>
<li>Installs in less than 60 minutes using factory mounting points</li>
<li>No cutting or drilling to engine compartment is required</li>
<li>Replaces OE air filter with high flow, high efficiency 360 degree radial flow air filter</li>
<li>Washable/reusable air filter with the deepest pleats in the industry is the largest possible in the space allowed</li>
<li>Replaces factory air box with a uniquely designed air box that allows the filter to be sized beyond factory limits</li>
<li>Replaces factory intake tube with a custom-designed intake tube that accelerates airflow to the turbo or throttle</li>
<li>Limited lifetime warranty</li>
</ul>[/HTML]


I know that is all right for bullets so I placed it in.. and I used this line here to make it display VIA the database using PHP

[PHP]<p align="center"><?php echo $fp1;?></td>[/PHP]

What happens when I run it all I get

"

yep just a " and thats it...

Anyone have any ideas? or be able to shine some light on this issue.

The server is running
phpMyAdmin 2.5.3
MySQL 4.1.14-standard

incase anyone needed to know no idea if that makes a diff and I have php5 on there.
Jan 10 '07 #1
3 1216
ronverdonk
4,258 Expert 4TB
I could find no problem in displaying the html from the db. I used the following code:[php]// connect server and db
$res=mysql_query("select html from xxx");
$row=mysql_fetch_assoc($res);
echo $row['html'];[/php]
So show the code you are using to get it out of the db and displaying it.

Ronald :cool:
Jan 10 '07 #2
Chrisjc
375 256MB
I could find no problem in displaying the html from the db. I sued the following code:[php]// connect server and db
$res=mysql_query("select html from xxx");
$row=mysql_fetch_assoc($res);
echo $row['html'];[/php]
So show the code you are using to get it out of the db and displaying it.

Ronald :cool:
I posted the code i am using above... thats what I have in the DB in my row for "fp1" so I have no idea.. are you saying I have to tell it there is HTML in the database?
Jan 10 '07 #3
ronverdonk
4,258 Expert 4TB
Things get confused. The following shows how I setup the table, inserted your data and extracted it again to be displayed.
[php]<?php
/*------------------------------------------------------
table was created and record inserted as the following:
--------------------------------------------------------
create table xxx (id int primary key auto_increment, html text);
insert into xxx values (0, '<ul>
<li>Pro-GUARD 7 high flow, high efficiency filter media air filter</li>
<li>Increases horsepower up to 100 HP depending on application</li>
<li>Improves torque up to 112 lbs/ft depending on application</li>
<li>Maximizes airflow for better acceleration and responsiveness</li>
<li>Improved performance results in greater fuel efficiency</li>
<li>Installs in less than 60 minutes using factory mounting points</li>
<li>No cutting or drilling to engine compartment is required</li>
<li>Replaces OE air filter with high flow, high efficiency 360 degree radial flow air filter</li>
<li>Washable/reusable air filter with the deepest pleats in the industry is the largest possible in the space allowed</li>
<li>Replaces factory air box with a uniquely designed air box that allows the filter to be sized beyond factory limits</li>
<li>Replaces factory intake tube with a custom-designed intake tube that accelerates airflow to the turbo or throttle</li>
<li>Limited lifetime warranty</li>
</ul>';
*/
//
// connect to server and db
// here I get the html text out of the db
$res=mysql_query("select html from xxx");
$row=mysql_fetch_assoc($res);
// and display it
echo $row['html'];
?>
[/php]
That's all!

Ronald :cool:
Jan 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Squirrel | last post: by
4 posts views Thread by Fergus O'Shea | last post: by
2 posts views Thread by ViperDK | last post: by
3 posts views Thread by fjm67 | last post: by
2 posts views Thread by Giedrius | last post: by
14 posts views Thread by jcage | last post: by
15 posts views Thread by lxyone | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.