Python mysql fetch_row 手记

在python的mysql中, fetch_row 默认是不传递参数的, 只返回一条且没有column的数据tuple.

但是在仔细看了API文档之后, 发现有两个参数: num_results和display_column

num_result: 默认只显示一条, 当传入0时, 将显示全部数据. 否则根据你的数字显示数据条数
display_column: 默认不显示
1. 只显示column名
2. 显示格式为 table.column

Leave a Comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: