Welcome to Dream.In.Code
Become an Expert!

Join 150,413 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 971 people online right now. Registration is fast and FREE... Join Now!




Alternatives to VARCHAR in MySQL?

 
Reply to this topicStart new topic

Alternatives to VARCHAR in MySQL?

spearfish
31 Mar, 2008 - 05:30 AM
Post #1

Monkey in Training
Group Icon

Joined: 10 Mar, 2008
Posts: 746



Thanked: 2 times
Dream Kudos: 225
My Contributions
Hey---

I'm just working on a PHP project that works with MySQL, where there's a field in a table that is volatile. Right now I'm using VARCHAR, but there's a limit of 255 characters for that. Is there an alternative that's like varchar but allows more characters?

Thanks,
Spear

Edit #1:
MySQL version is 5.0.16. It would've been easy if I had 5.0.3 :-(

Edit #2:
Well it's working now, I simply changed the size to 355 even though I'm not supposed to be able to do that I cite:
~Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.
~phpMyAdmin - 2.11.2.1
MySQL client version: 5.0.16
Used PHP extensions: mysql

This post has been edited by spearfish: 31 Mar, 2008 - 05:42 AM
User is offlineProfile CardPM
+Quote Post

girasquid
RE: Alternatives To VARCHAR In MySQL?
31 Mar, 2008 - 07:41 AM
Post #2

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,299



Thanked: 19 times
Dream Kudos: 725
My Contributions
If you're going to be using it to store long amounts of text, you could also try the text type - although I'm told that using best practices, if you do this, you should never be running SELECT queries based on the value in a text column.
User is online!Profile CardPM
+Quote Post

spearfish
RE: Alternatives To VARCHAR In MySQL?
31 Mar, 2008 - 06:15 PM
Post #3

Monkey in Training
Group Icon

Joined: 10 Mar, 2008
Posts: 746



Thanked: 2 times
Dream Kudos: 225
My Contributions
Thanks, I'll look into that. Nope, I'm not selecting based on that.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 07:47PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month