While others have helped you with your current problem of splitting the column, I'm going to suggest that your future problem will be that you didn't normalize your database and put the favorites in their own related table. It seems highly likely that some day you might want to write a SQL query to find out which favorites link to which sites, or rewrite some URLs in the favorites, and you could do it more easily if favorites were a table.
-- supposing favorites are attached to user records
CREATE TABLE user_favorites (
userid integer not null,
title varchar(100) not null,
link varchar(255) not null,
num integer not null,
PRIMARY KEY (userid, title),
FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE
);
Or, even if you hate the idea of a second table, you could store favorites as JSON and on most modern databases you can also reach into that with SQL.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|