temporary tables in cake.

2009-05-28 Thread MalContented

Hi,
I am trying to use temporary tables for some data manipulation but
they don't seem to work...

Consider this simplified code:

$sql = 'create temporary table t_hold select * from hold';
$result = $model-query ( $sql ); // This returns true

$sql = 'select * from t_hold';
$result = $model-query ( $sql ); // This throws an error 1146 - Table
doesn't exist

Now, the same error also happens if I take the 'temporary' out of the
create statement.
Furthermore, if I stick a 'show tables' statement before and after the
select, the 't_hold' table appears in the resulting array indicating
that it has indeed been created.
I tried puting a commit after the create as we are using innodb
tables.

Does anyone know what's happening here / have a fix?

Thanks in anticipation.

Mal

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Database column level processing

2009-04-30 Thread MalContented

I need a way to process specific database columns when they are read
from or saved to the database.
Specifically, we need to format dates to a local formatting when read
and format them to database format when saved.

The only way I can see is to hook in to beforeSave and afterFind but
those hooks act on complex data structures (I have looked at Nik
Chankov's date formatter but it fails for all but the simplest
queries).

What would be ideal is to be able to hook in to just before/after the
sql query and process the data there.

Any suggestions?

TIA

Mal
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component not working in 1.2.1.8004

2009-03-16 Thread MalContented



On 2 Mar, 18:28, brian bally.z...@gmail.com wrote:
 On Mon, Mar 2, 2009 at 11:09 AM, Josh Prowse pro...@gmail.com wrote:

  HeyMal!

  Are you talking about your local /app/config/routes.php file, or is
  there some other file that contains those Router::connect statements?
  I'm having the same problem as you guys, and I can't figure out how to
  get my logins to work. IGH!!!

 Yes, that's the only place in which to put routing info.
Correct!  I removed all the routes I have added and have used absolute
paths wherever.


  On Feb 4, 5:36 am, MalContented goo...@mmcsoftware.co.uk wrote:
  I don't think so,  I have the following 2 lines in routes.php

  Router::connect('/login', array('controller' = 'user', 'action' =
  'login'));
  Router::connect('/logout', array('controller' = 'user', 'action' =
  'logout'));

 Shouldn't the controller value be users?

We're using a legacy database and had to disable the inflector as the
data model is fairly complex.
 (IMHO it's stupid to impose this sort of thing anyway and cake can
just barely do the job.  Symfony was far easier but the powers that be
won't let us use it).

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with cascade deleting in cake_1.2.1.8004.

2009-03-05 Thread MalContented

Can nobody help me with this?
My workaround requires me to alter the cake code to get the app
working, which is not a good idea.
Thanks, Mal
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with cascade deleting in cake_1.2.1.8004.

2009-02-24 Thread MalContented

I have a HABTM relationship and when I delete the main row, only the
1st related row gets deleted and the delete fails.  The problem seems
to be in the model::exists() function after calling from the start of
the model::del() function (line 1671).  The 1st time __exists is not
set and reset is false so a database query is performed on the
intersection table.  Subsequently, __exists is set so the previous
value is returned (line 1852), even when a new ID has been set.  This
is clearly wrong.  The delete succeeds when the call to the exists()
function (on line 1671) is supplied with a value of true for $reset.
Comments?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component not working in 1.2.1.8004

2009-02-04 Thread MalContented

I don't think so,  I have the following 2 lines in routes.php

Router::connect('/login', array('controller' = 'user', 'action' =
'login'));
Router::connect('/logout', array('controller' = 'user', 'action' =
'logout'));

For 1.2.0.7962 the auth component startup function evaluates both $url
and $loginAction to /login and the test on line 290 is false and
authentication proceeds.
However, in 1.2.1.8004 it evaluates $url to /usr/login and
$loginAction to /login so the test, now on line 305, is true and
authentication exits.
With the 2 router lines removed, $loginAction evaluates to /usr/login
so authentication again succeeds.

I suspecty that this is where the problem lies.

Mal

On 4 Feb, 00:36, Gwoo gwoo.cake...@gmail.com wrote:
 sounds like you have the wrong fields. Everything works just fine.
 Please see the AuthComponent test cases in the nightly build or svn
 version.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth component not working in 1.2.1.8004

2009-02-02 Thread MalContented

I have an application build with cake 1.2.0.7962 and implementing the
simple authentication detailed in the online manual.
I just upgraded to 1.2.1.8004 and now can no longer log in.
No messages are displayed and 40 dots are displayed in the password
box (the length of the password string) when the login button is
pressed.

Are there any known issues with this new version?

Thanks

Mal

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---