Forum Moderators: coopster
this is my php code:
$images=$data->exec_fetch_assoc("SELECT id, username, email, name, surname, status FROM main_users ORDER BY id ASC");
$tpl->assign("images",$images);
$tpl->display("adm_userlist.tpl");
array(6) { ["id"]=> string(1) "3" ["username"]=> string(8) "MaradoXx" ["email"]=> string(14) "email" ["name"]=> string(7) "Provost" ["surname"]=> string(10) "Sebastiaan" ["status"]=> string(1) "4" }
{foreach from=$images item=imagek name=imgs}
<tr>
<td width="5%">{$imagek.id}</td>
<td width="15%">{$imagek.username}</td>
<td width="15%">{$imagek.email}</td>
<td width="25%">{$imagek.name} {$imagek.surname}</td>
<td width="15%">{$imagek.status}</td>
</tr>
{foreachelse}
<tr>
<td colspan=5>
<center>No users registered</center>
</td>
</tr>
{/foreach}
Can somebody help me? :(
it clearly gives 6 rows (there are 6 fields used in the array) and from each value in the array the first char. Does somebody knows what I am doing wrong?
also this is the function to get the data out of the db:
function exec_fetch_assoc($query_string)
{
if($this->query_string <>"" && $query_string == "")
{
self::exec_query($this->query_string);
}
else
{
self::exec_query($query_string);
}
$this->end_result=mysql_fetch_assoc($this->result);
return $this->end_result;
}
[edited by: eelixduppy at 1:45 am (utc) on April 14, 2009]
[edit reason] removed screenshot url [/edit]
{foreach item="imagek" from=$images}
<tr>
<td width="5%">{$imagek.id}</td>
<td width="15%">{$imagek.username}</td>
<td width="15%">{$imagek.email}</td>
<td width="25%">{$imagek.name} {$imagek.surname}</td>
<td width="15%">{$imagek.status}</td>
</tr>
{/foreach}
I would start there then see what your output is