SV: [SMARTY] page result with mysql -- with plug-in function.return_paged_results.php
| From: | Paolo Nesti Poggi | Date: | Sun, 23 Nov 2003 15:35:53 +0000 |
| Subject: | SV: [SMARTY] page result with mysql -- with plug-in function.return_paged_results.php | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10591@lists.php.net to get a copy of this message | ||
Well it was not so clear, what I meant is that in your php you should have:
> $connection = mysql_connect("$hostname", "$username",
> "$password");
> $db = mysql_select_db("$database", $connection);
> $query = "select * from $table";
> $smarty->assign('db',$connection); <--$connection instead of $db
> $smarty->assign('query',$query );
Paolo
> -----Oprindelig meddelelse-----
> Fra: Paolo Nesti Poggi [mailto:pnp@italyflash.com]
> Sendt: 23. november 2003 15:02
>
>
> I don't use smartypages however it seems to me that what you call $connect
> is what you in fact should put as the $db parameter in smatypages, that is
> the link identifier.
>
> This means that within your setup
> $count_result = mysql_query($count_query,$db);
> should instead be
> $count_result = mysql_query($count_query,$connect);
>
> Have you tried that?
>
> Greets
> Paolo
>
> > -----Oprindelig meddelelse-----
> > Fra: Ivan R. Cardoso [mailto:ivan21@bol.com.br]
> > Sendt: 23. november 2003 13:09
>
> >
> > After some time.... i finaly found a way to make the
> > return_paged_results
> > (http://sourceforge.net/projects/smartypages/) plug-in to work.
> >
> > look;
> > ------------------------------------------------------------
> >
> > (*.tpl)
> >
> > {return_paged_results db=$db query=$query shown=10}
> >
> > <table width=100%>
> > <tr
> > bgcolor=0000ff><td>cod</td><td>name</td><td>timestamp</td></tr>
> > {section name=mysec loop=$records}
> > {strip}
> > <tr class=celldados bgcolor="{cycle
> > values="#f0f0f0,#999999"}">
> > <td width=10%>{$records[mysec].cod}</td>
> > <td>{$records[mysec].name}</td>
> > <td >{$records[mysec].timestamp}</td>
> > </tr>
> > {/strip}
> > {/section}
> > </table>
> > <p> {$page_string}
> >
> > ---------------------------------------------------------
> >
> > (*.php)
> >
> > $connection = mysql_connect("$hostname", "$username",
> > "$password");
> > $db = mysql_select_db("$database", $connection);
> > $query = "select * from $table";
> > $smarty->assign('db',$db );
> > $smarty->assign('query',$query );
> >
> > -----------------------------------------------------------
> >
> > The only way that i found the plug-in to work, was to
> > change(function.return_paged_results.php, about line 74 and
> > 101...) from this:
> >
> > $count_result = mysql_query($count_query,$db);
> >
> > To this:
> >
> > $count_result = mysql_query($count_query);
> >
> >
> > hope it helps someone, cause i took a while to find out....!
> >
> >
> > Ivan R. Cardoso
> >
> >
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>