Jump to content
php.lv forumi

session


Blitz

Recommended Posts

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

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 by Blitz
Link to comment
Share on other sites

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

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 by Blitz
Link to comment
Share on other sites

×
×
  • Create New...