In article ,
Chris Hare wrote:
>
>cursor.execute('select * from net where NetNumber > 0')
Unless your table is guaranteed to never change layout, I suggest that
instead listing fields is a Good Idea:
cursor.execute('select netNumber, netType, from net where NetNumber > 0')
Then the tuple
Chris Hare a écrit :
I have a database query result (see code below). In PHP, I would have said
list(var1,var2,var) = $result
Other already answered on the Python equivalent. But there's an IMHO
better way, which is to use (if the DB-API connector provides it) a
DictCursor, that yields dict
On 08/05/10 09:26, Chris Hare wrote:
I have a database query result (see code below). In PHP, I
would have said
list(var1,var2,var) = $result
and each element in the list would be assigned to each of the
named variables. I have my data coming out of the database,
and I can see it is a list. so
On Thu, Aug 5, 2010 at 7:26 AM, Chris Hare wrote:
>
> I have a database query result (see code below). In PHP, I would have said
>
> list(var1,var2,var) = $result
>
> and each element in the list would be assigned to each of the named
> variables. I have my data coming out of the database, and
I have a database query result (see code below). In PHP, I would have said
list(var1,var2,var) = $result
and each element in the list would be assigned to each of the named variables.
I have my data coming out of the database, and I can see it is a list. so my
question is, instead of having