On Mar 21, 3:19 pm, "stevenoone" <[EMAIL PROTECTED]> wrote: > Maybe one of the reasons this HABTM of question is > getting asked so frequently is that nobody's provided a really good, > definitive answer of how this works with clear example code for our > models, views, and controllers.
Having helped manage this mailing list for the better part of two years now, I can tell you with a fair bit of certainty that this is most decidedly not the case. There are a few categories of questions (HABTM-related questions being chief among them) which people seem to keep asking no matter how many times they are answered, or how much relevant, accurate, clear and consice information (and code) is provided. I can also tell you with a fair bit of certainty that there has been quite a bit. > I realize the onus is on us beginners > to educate ourselves, and maybe I'm an idiot who can't type five > letters in a search box, but I'm obviously not the only person who's > running into problems with this. Not that the burden isn't on us as a community to provide answers, but once those answers are provided, it's up to new users to at least put a little bit of time and effort into trying to find them before asking again. Failing to do so is not only disrespectful to those who are here to help, but you also end up doing a disservice to new users who come after you by diluting the pool of relevant information. By continuing to ask the same questions repeatedly, you actually make it *harder* to find answers. I wrote a whole essay on this very topic, which you can find here: http://cake.insertdesignhere.com/posts/view/11 > Thanks for your help. As for your actual problem, I'd say the biggest issue is that you're doing a manual query, which by doing so, you're just creating more trouble and complexity for yourself than you really need to. Start by reading up on models and how to query them here: http://manual.cakephp.org/chapter/models. Pay special attention to the entry on generateList(), then you can search the list for usage examples with select boxes. > On Mar 21, 11:44 am, "nate" <[EMAIL PROTECTED]> wrote: > > > Hi stevenoone, I'm afraid you'll have to forgive my frustration, as > > we've had a lot of problems with this lately, but if you abandon this > > framework out of an inability to enter a search query into the text > > box in the upper right-hand corner of the page, then I can't say I'll > > be sorry to see you go. This exact question has already been answered > > here more times than I care to count. > > >http://groups.google.com/group/cake-php/browse_thread/thread/1bf118d0... > > > On Mar 21, 2:03 pm, "stevenoone" <[EMAIL PROTECTED]> wrote: > > > > If I can't get this to work I'm going to have to abandon this > > > framework. I've been developing dynamic websites for 10 years, but > > > apparently this is just beyond me. I can't seem to get my multi-select > > > lists to auto-populate correctly or update changes in the database. To > > > get the auto-populate values I'm trying this in my serials_controller > > > > $this->set('mycomps', $this->Serial->query("SELECT computer_id FROM > > > computers_serials WHERE serial_id = $this->Serial")); > > > > and this in my edit.thtml > > > > $html->selectTag('Serial/Computer',$computer_options, > > > $mycomps,array('multiple' => 'multiple')); > > > > it isn't working and I don't know why. If i hard-code "WHERE serial_id > > > = 1" in the query it returns this array, but I don't see how to fit > > > that into my selectTag. > > > > Array > > > ( > > > [0] => Array > > > ( > > > [computers_serials] => Array > > > ( > > > [computer_id] => 2 > > > ) > > > ) > > > [1] => Array > > > ( > > > [computers_serials] => Array > > > ( > > > [computer_id] => 5 > > > ) > > > ) > > > ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---