difference between char and varchar data types in php

It is for static page, dynamic page, website, SEO, performance and other web development discussion
denish
Posts: 32
Joined: Fri Sep 19, 2014 5:34 am
Contact:

difference between char and varchar data types in php

Postby denish » Wed Oct 15, 2014 10:12 am

What is the difference between char and varchar data types?


Guest

Re: difference between char and varchar data types in php

Postby Guest » Sun Oct 19, 2014 9:04 am

Set char to occupy n bytes and it will take n bytes even if u r
storing a value of n-m bytes
Set varchar to occupy n bytes and it will take only the required space
and will not use the n bytes
eg. name char(15) will waste 10 bytes if we store 'romharshan', if each char
takes a byte
eg. name varchar(15) will just use 5 bytes if we store 'romharshan', if each
char takes a byte. rest 10 bytes will be free.


Return to “PHP, HTML, MYSQL and Web Hosting”

Who is online

Users browsing this forum: No registered users and 2 guests