Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Saving HTML into a DATABASE
Old 08-05-2011, 09:20 AM Saving HTML into a DATABASE
Junior Talker

Posts: 1
Trades: 0
im writing my website in php and html.

i need a script that will let me paste html code into a form,then save the code in a database field.

Afterwards i need to be able to get the code from the database assign it to a variable and be able to use the code anywhere in my main program.

any ideas on how to do this or if its even possible.
august471 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2011, 12:38 PM Re: Saving HTML into a DATABASE
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
This is definitely possible.

Some things to read:
eval()
PHP's MySQL support
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 08:06 PM Re: Saving HTML into a DATABASE
Junior Talker

Posts: 1
Trades: 0
You can directly save html code into database, use varchar datatype in the database,

Fetch it with PHP and assign a variable to it.
haradeep111 is offline
Reply With Quote
View Public Profile
 
Old 08-06-2011, 05:21 AM Re: Saving HTML into a DATABASE
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by haradeep111 View Post
You can directly save html code into database, use varchar datatype in the database,
Using a varchar data type would depend on what database server you were using. For MySQL a varchar column is 255 characters wide at maximum, so would not hold a page of HTML.

In MS SQL the limit is 8,000 characters, unless you create the table with varchar(max).

Your column datatype for MySQL should be TEXT or Memo for MSAccess

Comparison of SQL Datatypes
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 08-06-2011 at 05:22 AM..
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Saving HTML into a DATABASE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31059 seconds with 12 queries