On Mon, 2009-07-13 at 06:46 -0700, pl wrote: > The problem is in the query: > > sqlite> SELECT * FROM "messages" WHERE ("messages"."to" = 3) ORDER BY > created_at DESC; > 23|Hoi Pepijn|7|3|true|2009-07-13 07:40:41|2009-07-13 13:13:45|t > 22|Hoi testje|7|3|true|2009-07-13 07:21:44|2009-07-13 07:33:48|f > 21|Hoi sjaak|7|3|true|2009-07-13 07:12:19|2009-07-13 07:36:59|f > 19|En nu dan?|7|3|true|2009-07-13 07:02:20|2009-07-13 07:34:59|f > 17|Heel misschien nu|7|3|true|2009-07-13 06:46:40|2009-07-13 07:35:09| > f > 15|Hoi Pepi!|7|3|true|2009-07-13 06:40:30|2009-07-13 07:35:35|f > sqlite> SELECT * FROM "messages" WHERE ("messages"."archived" = > 'false') AND ("messages"."to" = 3) ORDER BY created_at DESC; > sqlite> > > Suggestions for a better query? Is it an SQLite/MySQL difference? > Never used SQLite before.
If I'm reading the results above correctly, it looks like the 'archived' field is the one at the end. Yes? If so, then the query needs to test for 'f' not 'false'. If not, this it looks like the archived field must be the one just before the first date and you show no records with a value of 'false'. HTH, Bill > On 13 jul, 15:23, bill walton <bwalton...@gmail.com> wrote: > > Hi pl, > > > > On Mon, 2009-07-13 at 06:10 -0700, pl wrote: > > > The strange thing is that Mongrel shows the right query: > > > Message Load (0.6ms) SELECT * FROM "messages" WHERE > > > ("messages"."archived" = 'false') AND ("messages"."to" = 3) ORDER BY > > > created_at DESC > > > > > But I don't see any messages anymore (archived and not archived). > > > > What does the database return if you execute the select outside of your > > app? (I'm assuming you either know the command-line syntax or have a > > GUI front-end.) > > > > Bill > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---