0

I am using XAMPP and I want to store image paths on my phpmyadmin database and I saw here: Database design : preferred field length for file paths that the best options to store file paths should be VARCHAR(MAX) or NVARCHAR(MAX).

As I cannot set VARCHAR(MAX) or NVARCHAR(MAX) on my phpmyadmin,

How can I store these paths on my database properly? I mean, what is the best option to store them on my database?

Edit: I have seen the question that has been marked as possible duplicate. I know that I can "simulate" the VARCHAR(MAX) on phpmyadmin but, as it does not exist by default, it would be better to use another length instead of MAX?

I think that if you set a path of length 100 and you have your MAX as the limit is not worth so VARCHAR(suitable number) would be better than VARCHAR(MAX) (or at least I think it would be better). I am new with MySQL so I do not know about the entrails of it (by the moment).

I think it can be problems of performance or maybe memory but I cannot find anything on the official documentation so please if you find something related post here.

Is there a suitable length for store paths on phpmyadmin? A number of length that it is usually used (and why).

Thanks in advance!

Community
  • 1
  • 1
Francisco Romero
  • 12,787
  • 22
  • 92
  • 167
  • 1
    Possible duplicate of [Equivalent of varchar(max) in MySQL?](http://stackoverflow.com/questions/332798/equivalent-of-varcharmax-in-mysql) – Isaac Bennetch May 09 '16 at 17:03

1 Answers1

1

the best way to do this is to create a VARCHAR(255) column. 255 because normally standard url should not exceed this size

If you can't do it directly you can try :

1) create your column as VARCHAR 2) in the structure part you can set the size that will be the max size of your column

jeremy-denis
  • 6,368
  • 3
  • 18
  • 35