marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 <?php include("inc/config.php"); $result = mysql_query("SELECT id, saturs FROM xx_lv.lapas WHERE id") or die("Nevar savienoties ar tabulu!"); $lapu_masivs = Array(); while ($row = mysql_fetch_assoc($result)){ $lapu_masivs[$row['id']]=$row['saturs']; } $lapa = (int)$_GET['lapa'] ? $_GET['lapa'] : 1; ?> Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Un kur tad 64. rindiņa? Neredzu! Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 (edited) sory - tepat ir! $lapa = (int)$_GET['lapa'] ? $_GET['lapa'] : 1; Edited December 8, 2008 by marlboro Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Un vai ir padots parametrs "lapa"? Ja nā, tad vajag pārbaudīt $_GET masīvu tādā pašā veidā, kā pārbaudīji pirms tam. Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 un ka tas butu japieraksta? kautvai mazdruscin uzvedini uz pareiza cella.. Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 (edited) pēc analoģijas kaut kā šādi: if(array_key_exists('lapa',$_GET){ $lapa = (int)$_GET['lapa']; } else { $lapa =1; } P.S. Patiesībā es nesaprotu, kādēļ gan uzreiz vaicājumā neizvēlēties tieši pareizo lapu un nevis lapu sarakstu. Edited December 8, 2008 by Aleksejs Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 (edited) P.S. Patiesībā es nesaprotu, kādēļ gan uzreiz vaicājumā neizvēlēties tieši pareizo lapu un nevis lapu sarakstu. un ka to butu darit ? ar sho man parluks tik baltu lapu ielade... if(array_key_exists('lapa',$_GET){ $lapa = (int)$_GET['lapa']; } else { $lapa =1; } Edited December 8, 2008 by marlboro Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Vispirms, pārliecinātos, ka man iedots pareizs $_GET['page']; if(array_key_exists('lapa',$_GET){ $lapa = (int)$_GET['lapa']; } else { $lapa =1; } un tad vaicājumu izveidotu šādu: $vaicajums = "SELECT id, saturs FROM x_lv.lapas WHERE id = $lapa"; FECI, QUOD POTUI, FACIANT MELIORA POTENTES Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 viss man iet tik talu liidz saku izmantot - if(array_key_exists('lapa',$_GET){ ka ir tas if.... ta uzreiz ielade vnk baltu lapu .... kapec ta varetu but ? Link to comment Share on other sites More sharing options...
xPtv45z Posted December 8, 2008 Report Share Posted December 8, 2008 Ieslēdz kļūdu paziņojumus. Tev neliekas, ka te kaut kā trūkst? "if(array_key_exists('lapa',$_GET){" Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 Tur ta lieta ka kludu pazinojums ieslegts - bet neko nedrukaa araa... tapec ar nesaprotu kas pa problemu... :( Ieslēdz kļūdu paziņojumus.Tev neliekas, ka te kaut kā trūkst? "if(array_key_exists('lapa',$_GET){" Link to comment Share on other sites More sharing options...
Aleksejs Posted December 9, 2008 Report Share Posted December 9, 2008 Nu, paklau! Tiešām pats nevari ieraudzīt? Man rodas iespaids, ka vaina ir nevis nevarēšanā, bet gan paviršībā un negribēšanā. if(array_key_exists('lapa',$_GET) Te jau runa nav par programmēšanu, bet par uzmanību, akurātumu un uzrakstītā izpratni. Atverošo iekavu skaitam jāsakrīt ar aizverošo iekavu skaitu! Link to comment Share on other sites More sharing options...
marlboro Posted December 9, 2008 Author Report Share Posted December 9, 2008 Viss skaidrs - kludu atradu - paldies.. if(array_key_exists('lapa',$_GET)) { Link to comment Share on other sites More sharing options...
Recommended Posts