Professional Web Applications Themes

how to determine column type - MySQL

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...

  1. #1

    Default how to determine column type


    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 Guest

  2. #2

    Default Re: how to determine column type

    Jeff wrote: 

    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
    J.O. Guest

  3. #3

    Default Re: how to determine column type

    Jeff schrieb: 

    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 pd, and I also
    recall that there are variants of the SHOW command that will return
    pd information.

    Regards,
    Jo
    Joachim Guest

  4. #4

    Default Re: how to determine column type

    > Could someone please tell me how I might determine the column type (char 

    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 Guest

  5. #5

    Default Re: how to determine column type

    Willem Bogaerts wrote: 
    >
    > 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,[/ref]

    shorter version of show fields is desc <table name> if you'd like to
    save time by typing less.

    --
    lark -- net
    To reply to me directly, delete "despam".
    lark Guest

Similar Threads

  1. Determine Cell Index from Column Name
    By dev648237923 in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: November 21st, 03:41 PM
  2. How determine type of DataItem in custom control??
    By A Traveler in forum ASP.NET Building Controls
    Replies: 0
    Last Post: October 18th, 08:01 PM
  3. How to determine which control in a template column was clicked...
    By Jim Mitchell in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: October 29th, 12:09 PM
  4. #24752 [Opn->Csd]: unknown column type "uniqueidentifier", type 35
    By iliaa@php.net in forum PHP Development
    Replies: 0
    Last Post: July 23rd, 04:56 PM
  5. #24752 [NEW]: unknown column type "uniqueidentifier", type 35
    By s dot sonnenberg at coolspot dot de in forum PHP Development
    Replies: 0
    Last Post: July 22nd, 01:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139