mysql fieldnames

R

rdack

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)
 
M

Mike C. Fletcher

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
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/
 
B

BadJake

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

Regards
John
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top