hi, i have this statement User.find_by_sql ("SELECT Users.id, COUNT(Howtos.user_id) FROM Howtos, Users WHERE Howtos.user_id = Users.id GROUP BY Users.id") this works on my local setup, but when i moved my application to another server, i get an error message that my Howtos table does not exist. thoughts? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Was your migrations successful? Did you check the database to see if it really is there? On Sun, 2006-12-31 at 06:15 +0100, koloa wrote:> hi, i have this statement > > User.find_by_sql ("SELECT Users.id, COUNT(Howtos.user_id) FROM Howtos, > Users WHERE Howtos.user_id = Users.id GROUP BY Users.id") > > this works on my local setup, but when i moved my application to another > server, i get an error message that my Howtos table does not exist. > > thoughts? >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yes, i have other functions that i call that accesses the howto table and display that in a view.. hmmmm. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2006-Dec-31 06:20 UTC
Re: sql statement works on local box but not on server?
Hi, please try running the SQL query on the remote machine at the command line for the db engine. Then report the error message that you''re receiving. -Conrad On 12/30/06, koloa <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi, i have this statement > > User.find_by_sql ("SELECT Users.id, COUNT(Howtos.user_id) FROM Howtos, > Users WHERE Howtos.user_id = Users.id GROUP BY Users.id") > > this works on my local setup, but when i moved my application to another > server, i get an error message that my Howtos table does not exist. > > thoughts? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hello, here is what i got mysql> SELECT Users.id, Users.login, COUNT(Howtos.user_id) as numhowtos FROM Howtos, Users WHERE Howtos.user_id = Users.id GROUP BY Users.id; ERROR 1146 (42S02): Table ''myname_myfirstapp.Howtos'' doesn''t exist Conrad Taylor wrote:> Hi, please try running the SQL query on the remote machine at the > command line for the db engine. Then report the error message that > you''re receiving. > > -Conrad-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i have other functions that i call on my howtos table that populate my index page. after i comment out the sql statement, my other functions work fine..im not sure what is happening. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2006-Dec-31 06:46 UTC
Re: sql statement works on local box but not on server?
Hi, try using ''howtos'' instead of ''Howtos'' for your table name. Let me know what happens. -Conrad On 12/30/06, poipu <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hello, here is what i got > > mysql> SELECT Users.id, Users.login, COUNT(Howtos.user_id) as numhowtos > FROM Howtos, Users WHERE Howtos.user_id = Users.id GROUP BY Users.id; > > ERROR 1146 (42S02): Table ''myname_myfirstapp.Howtos'' doesn''t exist > > > > Conrad Taylor wrote: > > Hi, please try running the SQL query on the remote machine at the > > command line for the db engine. Then report the error message that > > you''re receiving. > > > > -Conrad > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Conrad, Awesome thanks! it started working when i made everything lower case. much appreciation to all! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---