I have a db table that happens to have both uuid and int values in the
id column. The following code works for the int value but not the uuid
values.
?php echo $html-link('View',array('action'='view', $user['User']
['id'])); ?
Here is the generated sql and error:
Query: SELECT `User`.`id`,
It seems like there is a problem in your controller, rather than in
the FormHelper. Could you paste the view function ?
On Jan 23, 2008 6:38 AM, rogwei [EMAIL PROTECTED] wrote:
I have a db table that happens to have both uuid and int values in the
id column. The following code works for the
I'm not buying that, but here you go:
function view($id){
$this-set('user', $this-User-find($id));
}
From the debug output, it appears that the uuid is being passed
intact, but the generated sql garbles the where clause. Just in case,
here is the 3 level debug
For future reference, pasting a lot of code in a list serve message is
kind of ugly, if you would like to make me happier (really just being
selfish here) use a pasting service that preserves formatting and also
lets you add comments like
http://bin.cakephp.org/
or if you don't like cake
Try it:
$model-findById($id);
or
$model-find('first', array('conditions' = array('id' = $id)));
or
$model-find(array('conditions' = array('id' = $id)));
[]'s
On Jan 23, 2008 2:39 PM, Samuel DeVore [EMAIL PROTECTED] wrote:
For future reference, pasting a lot of code in a list serve message
Thanks Renan,
All three of those suggestions work. This also works:
$this-set('user', $this-User-find(id='$id'));
I didn't realize I had to use SQL syntax. So, I guess it was pilot
error.
Thanks again.
Roger
On Jan 23, 11:00 am, Renan Gonçalves [EMAIL PROTECTED] wrote:
Try it: