1
slyss
Help with template / query in myalbum-p
  • 2006/8/31 11:24

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


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]


Resized Image

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->getRowsNum

in the template i will go to use:

<img src="<{$rs_rand}>" border="0">
<
img src="<{$rs_last}>" border="0">


thanks for your help
[size=x-large]2008 Xoops Book[/size]

Login

Who's Online

240 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 240


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits