Skip navigation links

MySQL Forums :: General :: Store WYSIWYG SourceCode in MySQL Cells


Advanced Search

Re: Store WYSIWYG SourceCode in MySQL Cells
Posted by: Jay Alverson ()
Date: September 02, 2009 08:31PM

If you use a TEXT column you should be able to store the entire LIST in
one "cell" which would be a single row.

If you want to store each LI in a separate record then you could do that.

For Example, I keep a list of SPANs from this Website with the following
info. I have a field called "active" which I set to 1 or 0 depending on
whether I want to view that forum or not.

There's 110 rows (forums) here's 10.

mysql> desc mysqlforums;
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| id               | mediumint(9) | NO   | PRI | NULL    | auto_increment | 
| forumactive      | tinyint(1)   | YES  |     | 0       |                | 
| forumname        | varchar(100) | YES  |     | NULL    |                | 
| forummarkread    | varchar(500) | YES  |     | NULL    |                | 
| forumdatelast    | varchar(500) | YES  |     | NULL    |                | 
| forumdatecurrent | varchar(500) | YES  |     | NULL    |                | 
| forumurl         | varchar(500) | YES  |     | NULL    |                | 
+------------------+--------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

mysql> select forumname, forumdatelast from mysqlforums order by id asc limit 10;
+--------------------------+---------------------------------------------------------------------------------+
| forumname                | forumdatelast                                                                   |
+--------------------------+---------------------------------------------------------------------------------+
| Announcements            | <span class="forum-last-post" nowrap="nowrap">August 24, 2009 11:41PM</span>    | 
| Newbie                   | <span class="forum-last-post" nowrap="nowrap">September 02, 2009 02:24PM</span> | 
| Install                  | <span class="forum-last-post" nowrap="nowrap">September 02, 2009 02:36AM</span> | 
| Source, Builds, Binaries | <span class="forum-last-post" nowrap="nowrap">September 01, 2009 11:54AM</span> | 
| Docs                     | <span class="forum-last-post" nowrap="nowrap">September 01, 2009 12:00PM</span> | 
| QA                       | <span class="forum-last-post" nowrap="nowrap">September 01, 2009 11:59AM</span> | 
| Sample Database (Sakila) | <span class="forum-last-post" nowrap="nowrap">September 01, 2009 11:59AM</span> | 
| MySQL Migration Toolkit  | <span class="forum-last-post" nowrap="nowrap">August 31, 2009 12:46PM</span>    | 
| Microsoft SQL Server     | <span class="forum-last-post" nowrap="nowrap">September 02, 2009 08:40AM</span> | 
| Oracle                   | <span class="forum-last-post" nowrap="nowrap">September 02, 2009 05:03AM</span> | 
+--------------------------+---------------------------------------------------------------------------------+
10 rows in set (0.00 sec)

mysql> notee

I have wGET go download the main page, save it to a local file,
import that into MYSQL, do some parsing and reset the dates everytime
I use the script so that I can see which forums have new entries.

If I wanted to I could save the entire HTML page into a single field
in a single record.

It just depends on how you want to manage it.

>

Thanks, Jay

Options: ReplyQuote


Subject Written By Posted
Store WYSIWYG SourceCode in MySQL Cells Sven Peper 09/02/2009 08:09AM
Re: Store WYSIWYG SourceCode in MySQL Cells Peter Brawley 09/02/2009 08:20PM
Re: Store WYSIWYG SourceCode in MySQL Cells Jay Alverson 09/02/2009 08:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.