|
|
 |
FN-FORUM: FW: Problem with Smarty yikes!
date posted 3rd February 2008 15:02
Hey guys im having trouble with smarty wonder if any one could help - what
it is im using the {foreach} loop in my template file like so:
{foreach name=portfolio item=port from=$port_results}
Website Name:
{$port.website_name}
Website URL: {$port.website_url}
Languages/Tech Used:
{$port.languages}
Design: {$port.design}
Comments: {$port.comments}
{/foreach}
And the php code is getting the mysql data and putting it into an
associative array but im getting results like this:
/php code/
$query = "SELECT * FROM `port_details`";
$result = mysql_query($query);
$port_results = mysql_fetch_assoc($result);
$smarty->assign('port_results', $port_results);
/php code/
Website Name: 1
Website URL: 1
Languages/Tech Used: 1
Design: 1
Comments: 1
Website Name: h
Website URL: h
Languages/Tech Used: h
Design: h
Comments: h
I don't no what is going wrong here as when i write a simple assoc array it
works but getting it from my db displays the above output any help would be
appreciated thanks!
Regards Chris
|
 |
|