Try looking at this page in the Manual

http://book.cakephp.org/1.3/en/view/1018/find

Should give you a good starting point

On Wednesday, 27 June 2012 01:53:46 UTC+12, Ditshwanelo wrote:
>
>  
> Im trying to populate data from database bt isnt,im a begginer sory for a 
> lame question
>  
> function download()
>  {
>    
>  $urlquery = $this->Newsletter->query("SELECT url,image_url,year,season 
> FROM newsletters WHERE status='Active'");
>      
>       foreach($urlquery as $URL)
>        {  
>       //echo '<a href="/".$hyperlink."/"><img 
> src="images/pdf.PNG"/><br/></a>';
>   // echo '<a href=".$hyperlink.">Newsletters<br/></a>';
>   
>   //variables
>    $hyperlink=$URL['Newsletter']['url'];
>    $year=$URL['Newsletter']['year']; 
>    $season = $URL['Newsletter']['season'];
>    $image_url=$URL['Newsletter']['image_url'];
>    print_r($season);
>    echo'<table width="350" border="1" cellpadding="0" cellspacing="0" >
>     <th>Year</th><th>Season</th><th>Download Newsletter</th>';
>          
>      echo'<tr>';
>      
>      echo"<td>$year</td>";
>       echo"<td>$season</td>";
>    echo '<td><a href=".$hyperlink."><img 
> src=".$image_url."/><br/></a></td>';
>    echo'</tr>';
>    
>      
>
>    echo'</table>';
>        
>    
>        }
>      //print_r($y);
>   
>     }
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to