1
hi everybody
first of all sorry if my english is not good...
my problem:
i need to show in myalbum/index.php 2 thumb with
First thumb: model order by random
Second thumb: last model joined
so...
i have made this code:
[b]// code for MODEL ORDER BY RANDOM[/b]
$sql = "SELECT imgurl ";
$sql.= " FROM ".$xoopsDB->prefix('myalbum3_cat');
$sql.= " ORDER BY rand()";
$sql.= " LIMIT 0 , 1 ";
$rs = $xoopsDB->query($sql) or die($xoopsDB->error());
$xoopsTpl->assign('rs_rand', $xoopsDB->getRowsNum($rs));
[b]// end code for MODEL ORDER BY RANDOM[/b]
[b]// code for LAST MODEL JOINED[/b]
$sql = "SELECT imgurl ";
$sql.= " FROM ".$xoopsDB->prefix('myalbum3_cat');
$sql.= " ORDER BY cid DESC";
$sql.= " LIMIT 0 , 1 ";
$rs1 = $xoopsDB->query($sql) or die($xoopsDB->error());
$xoopsTpl->assign('rs_last', $xoopsDB->getRowsNum($rs1));
[b]// end code for LAST MODEL JOINED[/b]
now the problem: in this code i receive only the numbers of lines of the query (one)... but i need to receive the string with the result of the query
the problem, i think, is:
$xoopsDB->getRowsNumin the template i will go to use:
<img src="<{$rs_rand}>" border="0">
<img src="<{$rs_last}>" border="0">
thanks for your help