Re: find() problem

2013-06-18 Thread first last
Thank you for writing back.
The error happens on every record.
 
The error is near  LEFT JOIN `table1` AS `NotMt` 
ON(`table2`.``  notmt  =`NotMt`.`id`)
No error near others ones like LEFT JOIN `table1` AS `Symp` ON 
(`table2`.`symp` =`Symp`.`id`)
 
Table1 is the 2 records
 
id   name   createdmodified   
created_by  modified_by

1Yes2010-07-01 11:01:01   2010-07-01 
11:01:04 1 1  
2No 2010-07-01 11:01:012010-07-01 11:01:04 
1 1
 
id tinyint(4) PK
name   varchar(10)
createddatetime
modified  datetime
created_by  int(11) UN
modified_by int(11) UN
 
Table2 is the 4 records
 
id  p_id  c_vd_id  f_dt   sign_f_dt   c_h_id  
c_m_id c_age_id  diag symp  air 
notmt  modcolor tsttype  corr_date
corr_amtdef_amt def_dt   def1_desc
 def2_desc  air_dt  c_y_id c_m_id   c_d_id  f_comp   
---
1  61   2010-08-01   2011-08-021  
3   2   2  2  null  
1 253 
   null  null 0
null
  null null  nullnull0
2  71   2010-09-01   2010-09-0210
21 10 1  1  null  
1 133   1999-01-01 7.00 
0
null  
null 141   1   1
3  91   2011-08-22   
2011-10-03123   
4   1  1  
null  1 163 
  2003-01-19 14.00   0
null   
   null 101   1   1
4  15  1   2011-12-01   2012-01-0911
11 15 1  1  1 
 1 233   null
  null  12010-01-01  1265 AC (H771T)  3445 
(+2) S1null 3  4241
 
c_rev_idc_rev_dt rev_bycreated
 modifiedcreated_bymodified_by 
--
null null null 2011-09-07 12:11:30
2011-09-07 12:11:302 2
null null null 2011-09-08 14:32:08
2011-09-08 14:32:085 5
null null null 2011-10-10 13:05:36
2011-10-10 13:05:365 5
null null null 2012-09-13 14:31:55
2012-09-13 14:31:555 5
 
idint(11) PK
p_idint(11) UN
c_vd_id  smallint(5) UN
f_dtdate
sign_f_dt   date
c_h_id   smallint(6) UN
c_m_id  smallint(6) UN
c_age_id   smallint(6) UN
diag   tinyint(4)
symp tinyint(4)
air  tinyint(4)
notmt tinyint(4)
mod   smallint(6) UN
color  smallint(6) UN
tsttype   smallint(6) UN
corr_dt   date
corr_amtfloat(7,2)
def_amt tinyint(2)
def_dt date
def1_desc  varchar(50)
def2_desc  varchar(50)
air_dt date
c_y_id   smallint(6) UN
c_m_id  smallint(6) UN
c_d_id   smallint(6) UN
f_comp  tinyint(2) 
c_rev_idsmallint(6) UN
c_rev_dtdate
c_rev_by   varchar(50)
created datetime
modified   datetime
created_by   int(11) UN
modified_by int(11) UN
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at 

Re: find() problem

2013-06-18 Thread first last
 THink I found the problem. A tab in a value in an array of arrays called 
$belongsto. Not sure, want to test more, but error messages gone.
Thank you cricket and John.
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: find() problem

2013-06-17 Thread first last


function evFrmCreate($model, $fields, $currentId, $limit='50'){
  //the only reason we have limit set is because the Upload Additional 
Information can have more 
  // than 1 without being wrong. Where we need to se the problem with other 
forms
  $record = $this-$model-find('all', array( 'conditions' = 
array($model.'.id' = $currentId),
//   'fields' = $fields,
//   'recursive' = -1,
   'limit'=$limit));
  //pass the field to be included in the search
  $isComplete = $this-isComplete($model, $fields, $record);
--
--
 
Thank you for writing cricket.
I hope this is the code you want to see.
This seems to be where the query's made.
The error with col1 outside the tickmarks (`.`` col1) in the first post 
causes $record to have nothing in it, causing invalid arguement 
error in foreach() in functions like isComplete().
Please let me know if there's something else that would help.
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: find() problem

2013-06-17 Thread John
You're not giving us any hint of what data you're passing in to your 
function. With recursive = -1 I don't believe you shouldn't be getting any LEFT 
JOINs automatically so I think you're passing in something strange.

On Monday, June 17, 2013 3:14:31 PM UTC+3, first last wrote:

 function evFrmCreate($model, $fields, $currentId, $limit='50'){
   //the only reason we have limit set is because the Upload Additional 
 Information can have more 
   // than 1 without being wrong. Where we need to se the problem with 
 other forms
   $record = $this-$model-find('all', array( 'conditions' = 
 array($model.'.id' = $currentId),
 //   'fields' = $fields,
 //   'recursive' = -1,
'limit'=$limit));
   //pass the field to be included in the search
   $isComplete = $this-isComplete($model, $fields, $record);
 --
 --
  
 Thank you for writing cricket.
 I hope this is the code you want to see.
 This seems to be where the query's made.
 The error with col1 outside the tickmarks (`.`` col1) in the first post 
 causes $record to have nothing in it, causing invalid arguement 
 error in foreach() in functions like isComplete().
 Please let me know if there's something else that would help.
  


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: find() problem

2013-06-14 Thread lowpass
I have an idea but would rather see the code first.


On Fri, Jun 14, 2013 at 2:45 PM, first last van...@gmail.com wrote:

 No experience with PHP so sorry for my ignorance.

 A find() in a CakePHP 1.3 program is making a query with a MySQL syntax
 error 1064.
 The part of the query causing the error looks like LEFT JOIN `table1` AS
 `t1` ON (`table2`.``col1=`t1`.`id`). Col1 is outside of the
 backquotes.
 It's a very long query with other similar left joins that show no error.

 What can cause this and how can it be fixed ?


 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: find problem on the associated model

2006-07-20 Thread [EMAIL PROTECTED]

yes the executions table isn't included in the applications query.
I will try your code but mine should work, shouldn't it ?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: find problem on the associated model

2006-07-05 Thread AD7six

Hi wluigi,

Set debug to 2 and you will almost certainly see that the execution
table isnĀ“t included in the Application query.

As you are looking for a specific Execution, why not restructure your
code to be of the form:
$ExecutionData=$this-Application-Execution-findById($ExecutionId);
$applications =
isset($ExecutionData['Application'])?$ExecutionData['Application']:Array();
etc.

HTH, Cheers,

AD7six


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: find problem on the associated model

2006-07-04 Thread ShepherdWeb

I'm assuming you do actually have a table called executions...right?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: find problem on the associated model

2006-07-04 Thread [EMAIL PROTECTED]

yes and an other applications


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---