ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
Re: [Tutor] Mysql BLOB strangeness?
by Adam Cripps other posts by this author
Mar 19 2006 12:20AM messages near this date
Re: [Tutor] Mysql BLOB strangeness? | Re: [Tutor] Mysql BLOB strangeness?
On 3/18/06, Brian Gustin <brian@[...].com>  wrote:
>  Oh. just found the original question.. :)
> 
>  OK perhaps this would be more helpful if you were to manually query
>  mysql on command line and paste the results it outputs here.
> 
>  what I am betting is your method to get the data out of teh query is
>  doing exactly what you tell it to.. :)
> 
>  but this hinges on the answer to "what is the original row of data
>  returned by commandline mysql query"
> 
>  keep in mind Mysql returns a result set as an array (a list or
>  dictionary, when it is associative, if you will)
> 
>  what your code is doing is taking the row (array) and appending it to an
>  additional list..
> 
>  and where you print the whole, you are basically printing out the
>  multi-dimensional array, and I am betting the *last element* returned
>  non-null in the mysql query is the content field.. :)
> 
>  but again, it depends on what the actual content is..
> 
>  run these two in mysql command line:
> 
>  mysql> show create table report;
>  mysql> select * from report limit 1;
> 
>  and let me know the results.. :)
> 
>  I doubt that blob vs. text has anything to do with this issue :)
> 
>  Bri!

Thanks again Bri, for both your responses.

As requested -

mysql>  show create table report:
| report | CREATE TABLE `report` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `content` blob,
  `author` int(10) default NULL,
  `published` varchar(10) default 'n',
  `rejected` char(1) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM |

mysql>  select * from report limit 1;
+----+-------+-----------------+--------+-----------+----------+
| id | title | content         | author | published | rejected |
+----+-------+-----------------+--------+-----------+----------+
|  1 | Test  | This is a test  |      0 | n         | NULL     |
+----+-------+-----------------+--------+-----------+----------+
1 row in set (0.02 sec)
(shame this doesn't monospace in Gmail)


You are right to bet that the last non-null field (part of the array)
is the content field (select id, title, content from report)
Adam
--
http://www.monkeez.org
PGP key: 0x7111B833
_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Adam Cripps
Brian Gustin
Adam Cripps
Brian Gustin
Adam Cripps
Kent Johnson
Brian Gustin
Adam Cripps
Kent Johnson
Adam Cripps
Liam Clarke
Brian Gustin
Adam Cripps
Hugo González Monteverde

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved