mysql fieldnames

Discussion in 'Python' started by rdack, Aug 11, 2003.

  1. rdack

    rdack Guest

    how can i retrieve database names and fieldnames from mysql 4 using
    MySQLdb 0.9.2 from python 2.3?
    (on mac osx 10.2.6)
    rdack, Aug 11, 2003
    #1
    1. Advertising

  2. Here's the code I use for it:

    http://cvs.sourceforge.net/cgi-bin/...rev=HEAD&content-type=text/vnd.viewcvs-markup

    (You can scroll down to the bottom to see the low-level queries).

    Basically MySQL has a "show" SQL query for the database types. You can
    use regular DB-API calls to get the results of running those queries.

    HTH,
    Mike

    rdack wrote:

    >how can i retrieve database names and fieldnames from mysql 4 using
    >MySQLdb 0.9.2 from python 2.3?
    >(on mac osx 10.2.6)
    >
    >

    _______________________________________
    Mike C. Fletcher
    Designer, VR Plumber, Coder
    http://members.rogers.com/mcfletch/
    Mike C. Fletcher, Aug 11, 2003
    #2
    1. Advertising

  3. rdack

    BadJake Guest

    You can execute the queries
    SHOW DATABASES;
    or
    SHOW COLUMNS FROM your_table_name

    Regards
    John
    BadJake, Aug 12, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Balapa

    Elegant way of returning FieldNames?

    Jay Balapa, Aug 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    322
    John Timney \(Microsoft MVP\)
    Aug 7, 2003
  2. Beren

    Duplicate fieldnames in Datareader

    Beren, Jan 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    474
    Beren
    Jan 7, 2005
  3. Ted To

    DictReader and fieldnames

    Ted To, Mar 19, 2009, in forum: Python
    Replies:
    0
    Views:
    288
    Ted To
    Mar 19, 2009
  4. Guest
    Replies:
    7
    Views:
    120
    Guest
    Dec 8, 2003
  5. Ward

    referencing an object's fieldnames

    Ward, Apr 12, 2006, in forum: Javascript
    Replies:
    2
    Views:
    71
Loading...

Share This Page