ajloun
02-16-2010, 07:29 AM
Hello
In this code , it Should Print out all the titles where cid=$cid..
But for Some reason it only Prints One Result ( One title) . when i'm sure i have More than One Title in my Mysql ..
The Funy thing is it all ok if i do Not use Smarty ..
this the php
<?php
$cid = $_GET['cid'];
$data = mysql_query("SELECT * FROM ".$DB->prefix("gallery")." WHERE category='$cid' ") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$mytest= array();
$mytest['title'] = $myts->htmlSpecialChars($info['title']);
$mytest['name'] = $myts->htmlSpecialChars($info['name']);
$smarty->assign('title', $mytest['title']);
$smarty->assign('name', $mytest['name']);
}
?>
tmplate
<table cellpadding="5" cellspacing="5" class="outer">
<tr>
<td class="even">
<{$name}></td>
</tr>
<tr>
<td class="even">
<{$title}></td>
</tr>
</table>
In this code , it Should Print out all the titles where cid=$cid..
But for Some reason it only Prints One Result ( One title) . when i'm sure i have More than One Title in my Mysql ..
The Funy thing is it all ok if i do Not use Smarty ..
this the php
<?php
$cid = $_GET['cid'];
$data = mysql_query("SELECT * FROM ".$DB->prefix("gallery")." WHERE category='$cid' ") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$mytest= array();
$mytest['title'] = $myts->htmlSpecialChars($info['title']);
$mytest['name'] = $myts->htmlSpecialChars($info['name']);
$smarty->assign('title', $mytest['title']);
$smarty->assign('name', $mytest['name']);
}
?>
tmplate
<table cellpadding="5" cellspacing="5" class="outer">
<tr>
<td class="even">
<{$name}></td>
</tr>
<tr>
<td class="even">
<{$title}></td>
</tr>
</table>