vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Could someone please tell me how I might determine the column type (char vs. integer is good enough) if I know the column name? Thanks Jeff -- Posted via a free Usenet account from http://www.teranews.com |
| |||
| Jeff wrote: > > Could someone please tell me how I might determine the column type (char > vs. integer is good enough) if I know the column name? I don't see the column name to have any real link to what type of column it is. But if you are to create a table, and not sure what type to use, then you have to think of what you want to store, has it to be something that a human must be able to determine what the data means when looking on that one table or not. Text based searches do take longer time than numeric (int/float), while numeric values always takes the full size, text based many times just takes the length of the string. I would avoid to use text based ID columns. -- //Aho |
| |||
| Jeff schrieb: > > Could someone please tell me how I might determine the column type (char > vs. integer is good enough) if I know the column name? Take a look at the SHOW commands in the mysql manual. SHOW CREATE TABLE already has the information you need, but IIRC it's just a single text string that would need to be parsed, and I also recall that there are variants of the SHOW command that will return parsed information. Regards, Jo |
| |||
| > Could someone please tell me how I might determine the column type (char > vs. integer is good enough) if I know the column name? If you are doing so from PHP, there is a separate function for that. In SQL, the command: SHOW FIELDS FROM <table name> Will get you the column details. Best regards, -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
| ||||
| Willem Bogaerts wrote: >> Could someone please tell me how I might determine the column type (char >> vs. integer is good enough) if I know the column name? > > If you are doing so from PHP, there is a separate function for that. In > SQL, the command: > > SHOW FIELDS FROM <table name> > > Will get you the column details. > > Best regards, shorter version of show fields is desc <table name> if you'd like to save time by typing less. -- lark -- hamzee@sbcdeglobalspam.net To reply to me directly, delete "despam". |