Domanda

Voglio recuperare le righe intermedie da dalla banca dati.

Come per ultimi 10 righe userò limite:

    return Doctrine_Query::create()
                ->select('v.*')
                ->from('Video v')                   
                ->where("v.community_id='$community_id' AND v.user_id='$user_id' AND v.published='$published'")
                ->orderBy('v.id DESC')
                ->limit(10)
                ->execute();        

, ma cosa succede se voglio 110-120 righe? Qualcuno mi può dire a riguardo? come scrivere questo tipo di query in dottrina

È stato utile?

Soluzione 4

Usa compensato clausola ... chk dis

Altri suggerimenti

Utilizza il offset () clausola.

potrebbero usare un Doctrine_Pager

$page = 10;
$limit = 10;
$query = Doctrine_Query::create()
        ->select('t.*')
        ->from('SomeTable t')

$pager = new Doctrine_Pager(
    $query,
    $page,
    $limit
);

$rows = $pager->execute();

Per le righe 110-120, vuoi

LIMIT 109, 10
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top