我见了个数据库,其中有个student表,在程序中想得到这个表的各个字段名等信息,怎么得到??mySQL中应该有系统表来记录用户表的信息吧,请教一下了,望解答

解决方案 »

  1.   

    show create table student;
      

  2.   

    use information_schema;
    select COLUMN_NAME from COLUMNS where TABLE_SCHEMA='databasename' and TABLE_NAME='student';
      

  3.   

    我见了个数据库,其中有个student表,在程序中想得到这个表的各个字段名等信息,怎么得到??
    ---------- desc student;mySQL中应该有系统表来记录用户表的信息吧,请教一下了,望解答
    --------------- use mysql;
                    desc user;
      

  4.   


    show create table student;desc mysql.user;
      

  5.   

    use database_name;
    desc student;