|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Sun Jan 30, 2005 6:12 pm Post subject: Paginate dummy question |
|
|
The question I have probably is pretty simple, and I apologize for still not understanding.
However, I do not succeed to get the paginate function :
This is my .php code :
[php:1:087ea957ef]<?php
if(isset($_POST['multi']))
{
$motcle = $_POST['motcle'];
$anmin = $_POST['anmin'];
$anmax = $_POST['anmax'];
$nom_auteur = $_POST['nom_auteur'];
$resume = $_POST['resume'];
$auteur = $_POST['auteur'];
$contrat = $_POST['contrat'];
$connexion = connexion (NOM, PASSE, BASE, SERVEUR);
$query = "SELECT * FROM Actes, Bibliographie
WHERE Bibliographie.id = idBiblio
AND MotsClef LIKE '%$motcle%'
AND Nom_Auteur LIKE '%$nom_auteur%'
AND Resume LIKE '%$resume%'
AND Auteur LIKE '%$auteur%'
AND Contrat LIKE '%$contrat%'
AND annee BETWEEN $anmin AND $anmax ORDER BY annee
LIMIT ". SmartyPaginate::getCurrentIndex() . ", ". SmartyPaginate::getLimit() ;
$actes=sql_query($query);
$smarty->assign($actes, get_db_results());
SmartyPaginate::assign($smarty);
$smarty->display('actes.tpl');
}
?>[/php:1:087ea957ef]
the function :
[php:1:087ea957ef]<?php
function get_db_results($actes)
{
$_data = $actes;
SmartyPaginate::setTotal(count($_data));
return array_slice($_data, SmartyPaginate::getCurrentIndex(), SmartyPaginate::getLimit());
}
?>[/php:1:087ea957ef]
AND the error messages :
There must be something very basic that I am missing, could anyone please help ?
Many thanks,
Thiebo |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|