
 Ovidiu Androne - 2014-03-20 00:35:03
 
Greetings,
I am a beginner with php. I don't understand what I do wrong; without bound params, class works fine, all is perfect, but when I try to use bound values or params, the query fails to execute. My code is here:
$options = array(
    'results_per_page' => 6,
    'url' => '?page=*VAR*',
    'db_handle' => $conn,
    'using_bound_values' => true,
    'text_prev' => '<',
    'text_next' => '>',
    'text_first' => '«',
    'text_last' => '»',
    'current_page_is_link' => false,
    'max_links_between_ellipses' => 5,
    'show_links_prev_next_if_dead'  => false
)
try {
    $paginate = new pagination($page, 'SELECT * FROM aforisme ORDER BY data ?', $options);
 }
 catch(paginationException $e) {
    echo $e;
    exit();
 }
 $paginate->bindValue(1, 'ASC', PDO::PARAM_STR); 
 $paginate->execute();
 
 
 /*
 * If we get a success, carry on
 */
if($paginate->success == true)
{
    /*
     * Fetch our results
     */
    $result = $paginate->resultset->fetchAll();
Thank you!
}