MySql pocet riadkov

Sekcia: Aplikácie & Desktop 26.11.2012 | 14:40
Avatar Ivan Centos 6.x  Používateľ
Dobry den,

rad by som poziadal o pomoc. Na stranke mame chybne nastavene zobrazovanie vysledkov queries, kde nam zobrazuje len 30 zaznamov z databazy, aj ked ich tam je omnoho viac- dava nam odkazy na dalsie stranky vysledkov. Potreboval by som prepisat cucastny kod, aby zobrazoval cely report, bez moznosti klikania na dalsie stranky.. takze ked ma databaza 300 zaznamov, zobrazi sa na stranke 300 a nie len 30 a 10 dalsich liniek "Page: 2,3,4,5,6..."

Dakujem velmi pekne.


Tu je spomynany kod...:
if (isset($_REQUEST['sort']) AND $_REQUEST['sort']!="") {$sort = $_REQUEST['sort'];} else {$sort = $query_array["sort"];}
if (isset($_REQUEST['dir']) AND $_REQUEST['dir']!="") {$dir = $_REQUEST['dir'];} else {$dir = $query_array["dir"];}
if (isset($dir) AND $dir=="ASC") { $new_dir = "DESC"; }else{ $new_dir = "ASC";}
if (!isset($_REQUEST["show_all"])) { $show_all = "0"; }else{ $show_all = $_REQUEST["show_all"]; }
if (!isset($_REQUEST["headline_addition"])) { $headline_addition=" "; } else { $headline_addition = $_REQUEST["headline_addition"]; }

if (isset($_REQUEST["page_count"])){ $page_count = $_REQUEST["page_count"]; } else { $page_count = 0;}
$page_prev = $page_count - 1;
if ($page_prev < 0){ $page_prev = 0; } else {}
$page_next = $page_count + 1;
$page_current = $page_count;
$page_count = $page_count * $count_system;


//Preparing the Qeuery
$sql_query=$query_array["sql"];
//SORT
$sql_sort=" ORDER BY " . $sort . " " . $dir;
//LIMIT
if(isset($show_all) AND $show_all!=1){
$sql_limit=" LIMIT " . $page_count . "," . $count_system;
}else{
$sql_limit="";
}
    • Re: MySql pocet riadkov 26.11.2012 | 14:52
      Avatar Miroslav Bendík Gentoo  Administrátor
      Stačí do URL adresy pridať parameter show_all=1 napr zoznam.php?show_all=1.
      • Re: MySql pocet riadkov 26.11.2012 | 14:56
        Avatar Ivan Centos 6.x  Používateľ
        Ako to dopisem do nasledujuceho kodu..?
        "30"=>array("name"=>"All Servers", "link"=>"./list.php?view=all_servers", "image"=>"images/server.png", "title"=>"All Servers",),
        "110"=>array("name"=>"All Services", "link"=>"./list.php?view=all_services", "image"=>"images/services.png", "title"=>"All Services",),
        atd...