HABTM find() results in SQL error

2007-02-19 Thread Bret Kuhns
I have the exact problem as in this topic: http://groups.google.com/group/cake-php/browse_thread/thread/1522701f158e90b8/a25f475b8f5230ee?lnk=gstq=habtm+JOIN+query+errorrnum=2#a25f475b8f5230ee - Query: SELECT `State`.`id`, `State`.`name`, `State`.`abbr` FROM `states` AS `State` JOIN

Re: HABTM find() results in SQL error

2007-02-19 Thread Bret Kuhns
'. Not an ideal solution, but it did solve the problem for MySQL 3.23 Regards, Langdon Bret Kuhns wrote: I have the exact problem as in this topic: http://groups.google.com/group/cake-php/browse_thread/thread/1522701f... --~--~-~--~~~---~--~~ You received this message

Protect controller actions from outside requests

2006-11-08 Thread Bret Kuhns
I would like to protect a controller action from being directly accessed directly by its URL. And no, I'm not talking about a user authentication system. I have two controllers: Payments and Orders. Payments is used first to save credit card information from the user, then it redirects to the

Re: Protect controller actions from outside requests

2006-11-08 Thread Bret Kuhns
@PhpNut Thanks for the quick reply. I tried several queries in the group and on google looking for what I needed and couldn't find a relevant solution (almost all results were about user authentication, othAuth, rdSimpleAuth...). I suppose it helps if you know exactly what to search for, but I

Re: Protect controller actions from outside requests

2006-11-08 Thread Bret Kuhns
@PhpNut The code snippet you gave me didn't work for me. I searched around and found this change ticket: https://trac.cakephp.org/changeset/3783/ . From the looks of the code, the 'requested' key is set to 1, not a boolean. I changed my condition operator to == so that PHP would attempt to cast

Re: Models, find/findAll and object programming

2006-08-31 Thread Bret Kuhns
Tony, I agree, the retuning of arrays doesn't support good object-oriented practices. But arrays are extremely flexible and easy to work with in PHP, so that's probably why the developers chose to use them in CakePHP. Version 2 of Cake, however, is supposively going to completely change the way

Re: Using a model for multiple tables

2006-08-29 Thread Bret Kuhns
I've never done this before so I have no idea how cake itself would handle it (if someone knows for sure, please chime in), but because models are objects that extend the AppModel, you could create a generic model object that extends AppModel which provides the generic structure of your multiple

Re: Using a model for multiple tables

2006-08-29 Thread Bret Kuhns
Yes John, I know what the AppModel is. But my idea is that instead of clogging your AppModel full of specific stuff that applies to only the few tables that Kabuto is talking about in this topic, you create a container model (that extends the AppModel for *application-wide* code) that holds the

Re: can you restrict the table fields cake recursively retrieves?

2006-08-18 Thread Bret Kuhns
on my own... Also, to John: John David Anderson (_psychic_) wrote: On Aug 17, 2006, at 8:01 PM, Bret Kuhns wrote: Contrary to popular practice, There's a reason for this... ;o) I was expecting that response. Though I've seen many benchmarks and quality articles that argue it's a viable

Re: can you restrict the table fields cake recursively retrieves?

2006-08-18 Thread Bret Kuhns
Chris, thanks for the reply and for backing up my database approach ;) Unfortunately that didn't fix the problem. The issue seems to be that, although my Album model can recursively retrieve data from the Image model, it can't access the Image model in my field list for the find() argument.

can you restrict the table fields cake recursively retrieves?

2006-08-17 Thread Bret Kuhns
Contrary to popular practice, I want to create a gallery script using BLOB fields in my database to store the images and thumbnails. When I retrieve the list of gallery albums, cake recursively gets all the fields from the associated images table. However, pulling all of this data at once with

Re: Help on saving a blob

2006-08-03 Thread Bret Kuhns
If you're doing what I think you are, then you're trying to save the contents of the file itself into a blob field of your database. However, your first example seems to be inserting the file*name* of the file into your blob field. You need the binary data of the file itself and store it in your

Re: flash() not working

2006-08-02 Thread Bret Kuhns
Also, don't forget you need to account for the redirect in your flash.thtml layout... in /app/views/layouts/flash.thtml, you must do this: head meta http-equiv=Refresh content=?=$pause?;url=?=$url? / /head $pause and $url are assigned to the layout by your call to flash().

Re: fundamental dispatcher strategy flawed?

2006-05-27 Thread Bret Kuhns
I completely agree with 100rk. MVC can be a design paradigm that people don't quite grasp right away. There are lots of people who don't understand Rails because of the same reason. But once those people start getting answers on the group/IRC/manual/API/etc and play with cakePHP more, they will

Re: {n} ?

2006-05-25 Thread Bret Kuhns
Marcelo, consider yourself lucky. Stay away from the evil that is ASP.NET... I've been developing websites for 6 years and I absolutely struggled through the class trying to figure out the very strange microsoft oddities thrown into ASP.NET. You wouldn't believe how involved it is just to put a

{n} ?

2006-05-24 Thread Bret Kuhns
I was using the generateList() method to create an array I could use in a select drop down. Using the method without params would create an array of the ids, but when I tried to use the $keyPath and $valuePath params to create a key=value array that I could use, nothing was returned. The manual

Re: {n} ?

2006-05-24 Thread Bret Kuhns
Thank you for your explanation. This idea seems very similar to ASP.NET's datasource concept in which data from any supported source (such as XML or most DBMS as mentioned) are treated exactly the same. This should become yet another useful resource for cake.

Re: {n} ?

2006-05-24 Thread Bret Kuhns
Ahah, after just finishing a semester on ASP.NET I feel confident in completely agreeing with you. CakePHP is one more reason to not use ASP.NET :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To

Re: data validation quirks

2006-05-23 Thread Bret Kuhns
Interesting insight nate, thanks very much :) I really should get around to reading a good book about MVC to learn more... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send