?
Solved

MySQL &phpMyAdmin Table

Posted on 2013-02-04
6
Medium Priority
?
625 Views
Last Modified: 2013-02-04
I have a program that dumps data into a MySQL database. This database has tables in it with first name, middle name, and Last name fields. Sometimes, users will have ht eneed to input the last name of Sanchez Jr. or Alder-manz . Basically, there is a chance for hyphens, commas, periods, etc to be in teh middle or last names. My question is, which data field type is better for this VARCHAR or TEXT? At this time I have it set to TEXT but have had some isses with the data getting updated in the table. I'm wondering if I should change it from TEXT to VARCHAR but do not know if it will cause other issues. What are your suggestions or recomendations?
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
SANDY_SK earned 1000 total points
ID: 38852251
in my opinion varchar is perfectly fine. The text data type you use only when the data to be stored is very large. that is if it is more than the varchar(MAX)

This link will give you a better idea
http://dev.mysql.com/doc/refman/5.5/en/column-count-limit.html
0
 
LVL 27

Assisted Solution

by:Lukasz Chmielewski
Lukasz Chmielewski earned 1000 total points
ID: 38852276
http://www.pythian.com/blog/text-vs-varchar/
Varchar fits, there is no need to store the names for such column data type as text.
0
 
LVL 15

Author Comment

by:wantabe2
ID: 38852379
If I would change this live database from TEXT to VARCHAR at this time, would I need to change anything in the php code? I was going to change the type to VARCHAR with a length to 50. Do you see any issues with that?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 38852449
For the safe solution I would create a new column, copy the data from text to new varchar and then delete the text one
0
 
LVL 11

Expert Comment

by:SANDY_SK
ID: 38852459
well i am not too sure of PHP but usually there is no difference the way data is read or written to a varchar column or a text column, it is usually the same. So i don't think there will be any problem.

to be on the safer side, you could test it first on a test table and then do it in the live production system
0
 
LVL 15

Author Closing Comment

by:wantabe2
ID: 38852517
Thank you both!
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this article, we’ll look at how to deploy ProxySQL.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question