Blitz Posted May 24, 2006 Report Share Posted May 24, 2006 Seit buus bisk kods: session_start(); if (!isset($_SESSION['mas'])) { $query_get_artikuls="SELECT ARTIKULS FROM N_KLPREC ORDER BY ARTIKULS"; $result_get_artikuls=ibase_query($handle_db, $query_get_artikuls); $_SESSION['mas']="true"; while ($row_get_artikuls=ibase_fetch_row($result_get_artikuls)) { $artikuls=trim($row_get_artikuls[0]); $len_artikuls=strlen($artikuls); if ($len_artikuls==7) { $value_count++; $_SESSION[$value_count]=$artikuls; } } } print_r($_SESSION); Lieta taada, ka tikko ieejot lapaa, par cik session[mas] nav defineets, savaac datus no datubazes un saliek tos sesijaa. Tikko ieejot lapaa vins smuki saliek visu sessijaa, bet refreshojot lapu visi dati kas no datubazes bij salikti, pazuud un paliek tikai $_SESSION[mas]... Kur varetu but problema, uz kuru pusi skatities? Datu apjoms ko liek sessijaa ir paliels, apmeram 25000 ierakstu, taa nevaretu but problema? Galigi nevaru izdomat kur problema... Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 Ietestē ar mazāku datu apjomu, tad redzēsi vai izmēram ir nozīme. Link to comment Share on other sites More sharing options...
Blitz Posted May 24, 2006 Author Report Share Posted May 24, 2006 (edited) ar mazakiem datu apmeriem tas pats. izmeram tomer nav nozime... + tfu, blin izradaas ka vinam nepatiik ka key ir skaitlis... varbut kadas idejas kaa sito apiet? Vajadzetu lai tocna sessijas masivas izveidotos ar secigiem skaitliem kaa kejiem... Edited May 24, 2006 by Blitz Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 Met iekš kāda $_SESSION['string_key'][$value_count] Link to comment Share on other sites More sharing options...
Blitz Posted May 24, 2006 Author Report Share Posted May 24, 2006 laikam nevarees... The keys in the $_SESSION associative array are subject to the same limitations as regular variable names in PHP, i.e. they cannot start with a number and must start with a letter or underscore. For more details see the section on variables in this manual. Varbut ir kadi citi varianti kaa, vienreiz ielaadejot datus no datubazes, pie katra refresha to nedarit atkal, bet lai ir taa ka vini kautkur saglabajas, un butu super atra pieeja viniem? Dati ir vairak vai mazak statiski, un nemainaas atkaribaa no lietotaja... Link to comment Share on other sites More sharing options...
v3rb0 Posted May 24, 2006 Report Share Posted May 24, 2006 (edited) ja tik vien tā bēda ka key nedrīxt būt skaitlis, tad $array[$skaitlis] vietā izmanto $array['_'.$skaitlis] Edited May 24, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
Vebers Posted May 24, 2006 Report Share Posted May 24, 2006 (is_numeric($value)) ? $value = '_'.$value : $value=$value; Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 Izmanto datubāzi operatīvajā atmiņā. Link to comment Share on other sites More sharing options...
Blitz Posted May 24, 2006 Author Report Share Posted May 24, 2006 (edited) nee tas nebuus iisti labi... man pa to masivu japlivinaas rinkii izmantojot integer keys... labi, paldies pa ieteikumiem, domasu pavisam citu variantu... + datubazee opearativajaa atminaa, laikam saucas heap, izklausas cerigi... pameginasu Edited May 24, 2006 by Blitz Link to comment Share on other sites More sharing options...
GedroX Posted May 24, 2006 Report Share Posted May 24, 2006 Laikam bija HEAP. Pats nevarēju īsti atcerēties. :) Link to comment Share on other sites More sharing options...
john.brown Posted May 24, 2006 Report Share Posted May 24, 2006 uzraksti objektu, kurā glabā to masīvu. Pie viena tur visu to sql daļu var sabērt iekšā. Un tad to objektu sessijā glabā. Link to comment Share on other sites More sharing options...
Recommended Posts