Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Entering long URLs - I thought I had fixed it

Quote Reply
Entering long URLs - I thought I had fixed it
hi

Sorry about the re-post of the problem which was
"...I would like to increase the total number of characters that can be submitted for the URLs of links added to the database. Long ones get truncated."

I managed to get the links table to show what Eliot suggested, not through changing anything in the links table. It didn't seem to work (whatever it was I was doing was probably wrong). Eliot suggested this solution '....Change the URL field in the Links table to either varchar(500) or use LongText.'

I managed to get varchar(500) to show up in the links table by changing the 255 under URL in the links.def file. That seemed to work as it now showed varchar(500) when I re-built, and checked the links table again.

However the reality is I can *still* only post 255 characters (the default value) in the URL section when adding a new link.

I am puzzled and at a loss what to do next.

Again the valuable advice of the forum is invited. Many thanks again.

Steve


the3Gportal.com


Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Make it a Text field instead of a Char. Then you can have unlimited characters.

Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Nope...LONGTEXT is the better field type to use, since you are still limited to 255 characters for TEXT field types.

Regards,

Eliot Lee
Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Please add replies to your ORIGINAL Threads, rather posting duplicate Threads in the forums.

Thank you.

Regards,

Eliot Lee
Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Column type TEXT seems to work fine in my tables.

Your right that I was wrong about the characters being unlimited though. It's limited to 65535 characters. Which should be enough for his Long URLs.

http://www.mysql.com/doc/C/o/Column_types.html

Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Eliot

Apologies - I wasn't sure of the protocol.

As a marketing guy, I am novice with respect to perl and stuff like that, so I am not clear what to do now after you have suggested LONGTEXT as the solution.

I searched the Links SQL postings and LONGTEXT only pops up in this thread :-( I looked at the Edit Links Table Definition panel within admin - focusing on URL section. Still no sign of what LONGTEXT is.

I got the Links.def file and substituted LONGTEXT for TEXT. I made size 600. I used TEXTAREA and kept the size at 600.

After each change - I saw that it was picked up in the Edit Liks Table panel.

After each of these steps I tried to post a 300 long URL - it fully fits into the text box where you put URLs (when adding a link) but once ADDED it truncates down to just 255 characters. Again.

Please be simple with me, if you can offer further advice, I'm not so experienced as most of the posters here

Thanks
Steve

Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Thanks for your suggestion, I tried it but it did not work. maybe I was doing the wrong thing :-( Can you explain simply but briefly how to do what you suggest?

Thanks

Steve

Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
This set up a flag when I first read it, but when you said it worked, I let it go. from teh MySQL manual:

In Reply To:
The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value between 1 and 255. (As of MySQL Version 3.23, the length of CHAR may be 0 to 255.) When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed.

Values in VARCHAR columns are variable-length strings. You can declare a VARCHAR column to be any length between 1 and 255, just as for CHAR columns. However, in contrast to CHAR, VARCHAR values are stored using only as many characters as are needed, plus one byte to record the length. Values are not padded; instead, trailing spaces are removed when values are stored. (This space removal differs from the ANSI SQL specification.)
For cross-language compatibility, "CHAR" types are usually limited to a one byte length descriptor, or 255 bytes in length.

MySQL also allows you to define the TEXT field with a size limit, to increase performance. TEXT fields are handled differently internally, so CHAR is better if you can use it

TEXT/LONG VARCHAR will allow up to 64kb of data
MEDIUMTEXT will allow up to 16mb

Also, TEXT fields can't be indexed, in older versions of MySQL, and there are other restrictions:

In Reply To:
Note that you can only add an index on a column that can have NULL values or on a BLOB/TEXT column if you are using MySQL Version 3.23.2 or newer and are using the MyISAM table type.
You might want to check the MySQL manual before trying to make alterations such as these....

If you are using the URL field _ONLY_ as a jump-to point, and take it out of the "Weight"/Index system, you might be able to get away with changing it to a "Text" field, but I don't know if the "Check Duplicates" will work on a Text field, due to the internal limitations.




PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: Entering long URLs - I thought I had fixed it In reply to
Thanks PugDog - I understood your explanation but realised this is beyond me, so I have managed to come up with a different approach to setting up a search directory for my new online store, thanks to you and everyone else who helped!

Steve