Re: Problem on view from custom sql

2012-11-10 Thread gloop
Hi,

whats the output of



On Saturday, November 10, 2012 7:54:16 AM UTC+1, suttipong Pratum wrote:
>
>
> Dear All
> 
>   i have problem for show on viewbecause  custom sql  
>
> this  custome sql  
>
> $querys = "select * from registers where id is not null and (phone 
> like '%$q%' ";
> $querys .= " or endyear like '%$q%' ";
> $querys .= " or address like '%$q%'";
> $querys .= " or name like  '%$q%' ";
> $querys .= " or studentCode like '%$q%' ) ";
> $searchs = $this -> Register -> query($querys);
>  
> $this -> set(compact('searchs'));
>
> and view   have error   : 
>
> Undefined index: studentCode
>
>
>  ?>
> 
> 
>  
> 
> 
>
> plz guide me  
>
> thank you
>

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Problem on view from custom sql

2012-11-09 Thread suttipong Pratum

Dear All

  i have problem for show on viewbecause  custom sql  

this  custome sql  

$querys = "select * from registers where id is not null and (phone like 
'%$q%' ";
$querys .= " or endyear like '%$q%' ";
$querys .= " or address like '%$q%'";
$querys .= " or name like  '%$q%' ";
$querys .= " or studentCode like '%$q%' ) ";
$searchs = $this -> Register -> query($querys);
 
$this -> set(compact('searchs'));

and view   have error   : 

Undefined index: studentCode





 



plz guide me  

thank you

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.