Re: Result of a query gets messed up

2008-06-12 Thread Jeff Loiselle
Weckman, Of course you could always chat with me since I wrote the Oracle driver. ;-) /jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroup

Re: Result of a query gets messed up

2008-06-03 Thread [EMAIL PROTECTED]
Bug tickets & patches can be submitted to https://trac.cakephp.org/ be sure to read the "Submitting Tickets" section on that page :) On Jun 2, 11:52 pm, weckmann <[EMAIL PROTECTED]> wrote: > Finally the answer ;-) > > Thanks a lot grigri... now at least I know where the problem is... I > will tr

Re: Result of a query gets messed up

2008-06-02 Thread weckmann
Finally the answer ;-) Thanks a lot grigri... now at least I know where the problem is... I will try to add some code to enable functions in Oracle... If I am successful... where would be the right place to post such a bugfix? Sorry for that n00b-question but I did not actively develop cake befo

Re: Result of a query gets messed up

2008-06-02 Thread grigri
> it might have something to do with the fact that Im using > Cake with an Oracle DB in this project... > > Perhaps in the latest Cake the problem is not known or solved for > Mysql, but still active for Oracle... Ahh, that explains much. See lines 250-251 of https://trac.cakephp.org/browser/br

Re: Result of a query gets messed up

2008-06-02 Thread weckmann
@AD7six: Im in no hurry fortunately ;) So I prefer to use this group and hopefully help others with the same problem. IRC cant be found by googling. Hm if you say mysql_fetch_field is responsible for the parsing of the answer, then it might have something to do with the fact that Im using Cake wi

Re: Result of a query gets messed up

2008-05-30 Thread grigri
I've used calulcated fields before with cake and never had this problem. What version are you using? I seem to remember on one ancient version the only way to get it to work was by starting the field with a parenthesis: $fields = array( 'Something.here', '(COMPLEX_FUNCTION(bla,blah,'woof','

Re: Result of a query gets messed up

2008-05-30 Thread AD7six
On May 30, 2:43 pm, weckmann <[EMAIL PROTECTED]> wrote: > using aliases does not help, because the problem occurs before the > "as"... the problem is the "." and the "," in the function. This > causes cake to think that a new table/column begins and this messes up > the array, I think. Assumpti

Re: Result of a query gets messed up

2008-05-30 Thread weckmann
using aliases does not help, because the problem occurs before the "as"... the problem is the "." and the "," in the function. This causes cake to think that a new table/column begins and this messes up the array, I think. So if I us an alias, the array still will have the assosiation "my_custom_

Re: Result of a query gets messed up

2008-05-29 Thread djiize
and what if you define an alias to your column? select users.id, users.name, my_custom_function(users.id, 'ABC') AS custom, users.phone from users where users.id > 500; or better : "AS users.custom" and another question, do you need to specify "users.id" instead of just "id" ? In your example, i

Re: Result of a query gets messed up

2008-05-29 Thread AD7six
On May 29, 8:53 pm, weckmann <[EMAIL PROTECTED]> wrote: > That is a small workaround... because then i can get the value > returned by the function by calling $result[0] > ['my_custom_function(users'][id] ... and I also have all other values > before. > > But that workaround does not work if you

Re: Result of a query gets messed up

2008-05-29 Thread weckmann
That is a small workaround... because then i can get the value returned by the function by calling $result[0] ['my_custom_function(users'][id] ... and I also have all other values before. But that workaround does not work if you need to call more than one function. It only works if you call just

Re: Result of a query gets messed up

2008-05-29 Thread b logica
What happens if you put the function call last in your query? On Thu, May 29, 2008 at 9:47 AM, weckmann <[EMAIL PROTECTED]> wrote: > > Then $result will hold the array which I showed in my last posting... > which is quiet useless because users.phone is missing (or anything > that comes after the

Re: Result of a query gets messed up

2008-05-29 Thread weckmann
> It sounds to me like you are asking the wrong question - what sql is > getting executed. > > AD Since I am using the query function of a model the executed SQL is correct, its just the string that i supply. That is not the problem. I already used the debug mode to see what gets executed. The

Re: Result of a query gets messed up

2008-05-29 Thread AD7six
On May 28, 1:12 pm, weckmann <[EMAIL PROTECTED]> wrote: > OK here you are: > > From my example above the returned array would look like: > > [0] >     [users] >         [id] => 1234 >         [name] => Johnson >     [my_custom_function(users] >         [id] => somesamplevalue > [1]. > > So,

Re: Result of a query gets messed up

2008-05-28 Thread b logica
I've run into the same problem but never learned how to get around it. I have one site that I very much want to re-write for Cake but it relies on many custom functions in Postrgresql. I thought that I might take a stab at it later this summer, using only Model::query(), but I'm not sure it's wort

Re: Result of a query gets messed up

2008-05-28 Thread weckmann
OK here you are: >From my example above the returned array would look like: [0] [users] [id] => 1234 [name] => Johnson [my_custom_function(users] [id] => somesamplevalue [1]. So, obviously he thinks that "my_custom_function(users" is a tables name because it

Re: Result of a query gets messed up

2008-05-28 Thread AD7six
On May 28, 12:30 pm, weckmann <[EMAIL PROTECTED]> wrote: > I need to do some complex queries with functions involved. I can call > them with the query (or execute) method of any model, but the result > gets splitted by cake in an array, and there it gets messed up, > because cake is trying to sp

Result of a query gets messed up

2008-05-28 Thread weckmann
I need to do some complex queries with functions involved. I can call them with the query (or execute) method of any model, but the result gets splitted by cake in an array, and there it gets messed up, because cake is trying to split the results in table names and column names. Example: select