IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Requêtes MySQL Discussion :

nom des champs d'une table


Sujet :

Requêtes MySQL

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 497
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 497
    Billets dans le blog
    1
    Par défaut nom des champs d'une table
    Bonjour

    ma question est bête, mais si je fais une recherche, on va dans tous les forums et pas seulement celui-là (dommage), donc je n’ai pas trouvé. En fait, je cherche une requête qui me donnerait le nom des champs à partir du nom de la table.

  2. #2
    Membre émérite
    Profil pro
    Inscrit en
    Octobre 2002
    Messages
    956
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2002
    Messages : 956
    Par défaut
    Bonjour,
    Si ton SGBD la reconnait il existe une table normalisée contenant les informations souhaitées, elle s'appelle information_schema.columns
    A+
    Soazig

  3. #3
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 497
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 497
    Billets dans le blog
    1
    Par défaut
    Je viens de rentrer cette requête :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    select * from information_schema.columns
    et j'ai obtenu la réponse imbittable suivante :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
     
     
    information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 utf8 utf8_general_ci varchar(60) select 
    information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint 19 0 bigint(3) select 
    information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLLATIONS ID 3 0 NO bigint 19 0 bigint(11) select 
    information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema COLLATIONS SORTLEN 6 0 NO bigint 19 0 bigint(3) select 
    information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS TABLE_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint 19 0 bigint(21) select 
    information_schema COLUMNS COLUMN_DEFAULT 6 YES longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 YES bigint 19 0 bigint(21) select 
    information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 YES bigint 19 0 bigint(21) select 
    information_schema COLUMNS NUMERIC_PRECISION 11 YES bigint 19 0 bigint(21) select 
    information_schema COLUMNS NUMERIC_SCALE 12 YES bigint 19 0 bigint(21) select 
    information_schema COLUMNS CHARACTER_SET_NAME 13 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS COLLATION_NAME 14 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMNS COLUMN_TYPE 15 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema COLUMNS EXTRA 17 NO varchar 20 60 utf8 utf8_general_ci varchar(20) select 
    information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 utf8 utf8_general_ci varchar(80) select 
    information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 utf8 utf8_general_ci varchar(255) select 
    information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 utf8 utf8_general_ci varchar(81) select 
    information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint 19 0 bigint(10) select 
    information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 YES bigint 19 0 bigint(10) select 
    information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema PROFILING QUERY_ID 1 0 NO bigint 19 0 bigint(20) select 
    information_schema PROFILING SEQ 2 0 NO bigint 19 0 bigint(20) select 
    information_schema PROFILING STATE 3 NO varchar 30 90 utf8 utf8_general_ci varchar(30) select 
    information_schema PROFILING DURATION 4 0.000000 NO decimal 9 6 decimal(9,6) select 
    information_schema PROFILING CPU_USER 5 YES decimal 9 6 decimal(9,6) select 
    information_schema PROFILING CPU_SYSTEM 6 YES decimal 9 6 decimal(9,6) select 
    information_schema PROFILING CONTEXT_VOLUNTARY 7 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING CONTEXT_INVOLUNTARY 8 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING BLOCK_OPS_IN 9 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING BLOCK_OPS_OUT 10 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING MESSAGES_SENT 11 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING MESSAGES_RECEIVED 12 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING PAGE_FAULTS_MAJOR 13 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING PAGE_FAULTS_MINOR 14 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING SWAPS 15 YES bigint 19 0 bigint(20) select 
    information_schema PROFILING SOURCE_FUNCTION 16 YES varchar 30 90 utf8 utf8_general_ci varchar(30) select 
    information_schema PROFILING SOURCE_FILE 17 YES varchar 20 60 utf8 utf8_general_ci varchar(20) select 
    information_schema PROFILING SOURCE_LINE 18 YES bigint 19 0 bigint(20) select 
    information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES ROUTINE_CATALOG 2 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 utf8 utf8_general_ci varchar(9) select 
    information_schema ROUTINES DTD_IDENTIFIER 6 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 utf8 utf8_general_ci varchar(8) select 
    information_schema ROUTINES ROUTINE_DEFINITION 8 YES longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema ROUTINES EXTERNAL_NAME 9 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES EXTERNAL_LANGUAGE 10 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 utf8 utf8_general_ci varchar(8) select 
    information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES SQL_PATH 14 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 utf8 utf8_general_ci varchar(7) select 
    information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime datetime select 
    information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime datetime select 
    information_schema ROUTINES SQL_MODE 18 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema ROUTINES DEFINER 20 NO varchar 77 231 utf8 utf8_general_ci varchar(77) select 
    information_schema SCHEMATA CATALOG_NAME 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema SCHEMATA SQL_PATH 5 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 utf8 utf8_general_ci varchar(81) select 
    information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema STATISTICS TABLE_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema STATISTICS NON_UNIQUE 4 0 NO bigint 19 0 bigint(1) select 
    information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint 19 0 bigint(2) select 
    information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema STATISTICS COLLATION 9 YES varchar 1 3 utf8 utf8_general_ci varchar(1) select 
    information_schema STATISTICS CARDINALITY 10 YES bigint 19 0 bigint(21) select 
    information_schema STATISTICS SUB_PART 11 YES bigint 19 0 bigint(3) select 
    information_schema STATISTICS PACKED 12 YES varchar 10 30 utf8 utf8_general_ci varchar(10) select 
    information_schema STATISTICS NULLABLE 13 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 utf8 utf8_general_ci varchar(16) select 
    information_schema STATISTICS COMMENT 15 YES varchar 16 48 utf8 utf8_general_ci varchar(16) select 
    information_schema TABLES TABLE_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLES TABLE_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLES ENGINE 5 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLES VERSION 6 YES bigint 19 0 bigint(21) select 
    information_schema TABLES ROW_FORMAT 7 YES varchar 10 30 utf8 utf8_general_ci varchar(10) select 
    information_schema TABLES TABLE_ROWS 8 YES bigint 19 0 bigint(21) select 
    information_schema TABLES AVG_ROW_LENGTH 9 YES bigint 19 0 bigint(21) select 
    information_schema TABLES DATA_LENGTH 10 YES bigint 19 0 bigint(21) select 
    information_schema TABLES MAX_DATA_LENGTH 11 YES bigint 19 0 bigint(21) select 
    information_schema TABLES INDEX_LENGTH 12 YES bigint 19 0 bigint(21) select 
    information_schema TABLES DATA_FREE 13 YES bigint 19 0 bigint(21) select 
    information_schema TABLES AUTO_INCREMENT 14 YES bigint 19 0 bigint(21) select 
    information_schema TABLES CREATE_TIME 15 YES datetime datetime select 
    information_schema TABLES UPDATE_TIME 16 YES datetime datetime select 
    information_schema TABLES CHECK_TIME 17 YES datetime datetime select 
    information_schema TABLES TABLE_COLLATION 18 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLES CHECKSUM 19 YES bigint 19 0 bigint(21) select 
    information_schema TABLES CREATE_OPTIONS 20 YES varchar 255 765 utf8 utf8_general_ci varchar(255) select 
    information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 utf8 utf8_general_ci varchar(80) select 
    information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 utf8 utf8_general_ci varchar(81) select 
    information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema TRIGGERS TRIGGER_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 utf8 utf8_general_ci varchar(6) select 
    information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint 19 0 bigint(4) select 
    information_schema TRIGGERS ACTION_CONDITION 9 YES longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema TRIGGERS ACTION_STATEMENT 10 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 utf8 utf8_general_ci varchar(9) select 
    information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 utf8 utf8_general_ci varchar(6) select 
    information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 YES varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema TRIGGERS CREATED 17 YES datetime datetime select 
    information_schema TRIGGERS SQL_MODE 18 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema TRIGGERS DEFINER 19 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 utf8 utf8_general_ci varchar(81) select 
    information_schema USER_PRIVILEGES TABLE_CATALOG 2 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema VIEWS TABLE_CATALOG 1 YES varchar 512 1536 utf8 utf8_general_ci varchar(512) select 
    information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 utf8 utf8_general_ci varchar(64) select 
    information_schema VIEWS VIEW_DEFINITION 4 NO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext select 
    information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 utf8 utf8_general_ci varchar(8) select 
    information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 utf8 utf8_general_ci varchar(3) select 
    information_schema VIEWS DEFINER 7 NO varchar 77 231 utf8 utf8_general_ci varchar(77) select 
    information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 utf8 utf8_general_ci varchar(7) select
    où est l'erreur ? (SGBD = MySQL). Cela dit, j'ai retrouvé un bout de code PHP qui manipulait le champ de la table (la table qui m'intéresse ne comporte qu'un seul champ) ; donc, c'est plutôt pour la culture.

  4. #4
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2009
    Messages
    133
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2009
    Messages : 133
    Par défaut
    Bonjour LaurentSc
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    SHOW COLUMNS FROM ta_table;
    Ionesco.

  5. #5
    Membre Expert
    Avatar de laurentSc
    Homme Profil pro
    Webmaster débutant perpétuel !
    Inscrit en
    Octobre 2006
    Messages
    10 497
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Webmaster débutant perpétuel !
    Secteur : Industrie

    Informations forums :
    Inscription : Octobre 2006
    Messages : 10 497
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par ionesco Voir le message
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    SHOW COLUMNS FROM ta_table;
    Merci : Nickel

  6. #6
    ced
    ced est déconnecté
    Rédacteur/Modérateur

    Avatar de ced
    Homme Profil pro
    Gestion de bases de données techniques
    Inscrit en
    Avril 2002
    Messages
    6 063
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France, Loiret (Centre)

    Informations professionnelles :
    Activité : Gestion de bases de données techniques
    Secteur : Agroalimentaire - Agriculture

    Informations forums :
    Inscription : Avril 2002
    Messages : 6 063
    Par défaut
    Citation Envoyé par laurentSc Voir le message
    où est l'erreur ? (SGBD = MySQL). Cela dit, j'ai retrouvé un bout de code PHP qui manipulait le champ de la table (la table qui m'intéresse ne comporte qu'un seul champ) ; donc, c'est plutôt pour la culture.
    Pour la culture , jette un œil dans ce tutoriel : http://cedric-duprez.developpez.com/...sql/catalogue/

    ced
    Rédacteur / Modérateur SGBD et R
    Mes tutoriels et la FAQ MySQL

    ----------------------------------------------------
    Pensez aux balises code et au tag
    Une réponse vous a plu ? N'hésitez pas à y mettre un
    Je ne réponds pas aux questions techniques par message privé, les forums sont là pour ça

  7. #7
    Expert éminent
    Avatar de CinePhil
    Homme Profil pro
    Ingénieur d'études en informatique
    Inscrit en
    Août 2006
    Messages
    16 818
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur d'études en informatique
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2006
    Messages : 16 818
    Billets dans le blog
    14
    Par défaut
    Citation Envoyé par laurentSc Voir le message
    requête qui me donnerait le nom des champs à partir du nom de la table.
    Je viens de rentrer cette requête :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SELECT * FROM information_schema.COLUMNS
    Tu veux seulement le nom mais ta requête demande toutes les colonnes. Ne soit pas étonné d'avoir plus que ce que tu demandes !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    SELECT COLUMN_NAME
    FROM information_schema.COLUMNS
    WHERE TABLE_SCHEMA = 'taBDD'
      AND TABLE_NAME = 'taTable'
    Philippe Leménager. Ingénieur d'étude à l'École Nationale Supérieure de Formation de l'Enseignement Agricole, en retraite... mais toujours Autoentrepreneur à l'occasion.
    Mon ancien blog sur la conception des BDD, le langage SQL, le PHP... et mon nouveau blog sur les mêmes sujets.
    « Ce que l'on conçoit bien s'énonce clairement, et les mots pour le dire arrivent aisément ». (Nicolas Boileau)
    À la maison comme au bureau, j'utilise la suite Linux Mageïa !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. récupérer la liste des noms des champs d'une table
    Par la_didise dans le forum Access
    Réponses: 2
    Dernier message: 29/05/2006, 16h55
  2. recuperation des nom des champs d'une table
    Par arawak dans le forum Access
    Réponses: 2
    Dernier message: 11/01/2006, 15h16
  3. récupérer le nom des champs d'une table d'une BDD-page web
    Par mathieu_r dans le forum Décisions SGBD
    Réponses: 3
    Dernier message: 09/06/2005, 14h02
  4. Modifier le nom des champs d'une table...
    Par Mr Capone dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 26/01/2005, 10h22
  5. nom des champs d'une table
    Par K-ZimiR dans le forum Requêtes
    Réponses: 6
    Dernier message: 22/04/2004, 14h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo