Aleksejs Posted December 5, 2008 Report Share Posted December 5, 2008 if(array_key_exists($atsledzina, $masivins)){ //drukajam $masivins[$atsledzina] } else { //drukajam A nava šitādas atsledzinas } Link to comment Share on other sites More sharing options...
marlboro Posted December 5, 2008 Author Report Share Posted December 5, 2008 (edited) nu itka sanaca bet tas nenoversh manu problemu... vnk izdruka ka neksiste tadz id .. un tas eroors man izlec araa kad esmu - /index.php Edited December 5, 2008 by marlboro Link to comment Share on other sites More sharing options...
Aleksejs Posted December 5, 2008 Report Share Posted December 5, 2008 Parādi, kāds šobrīd izskatās tas tavs kods un pilnu kļūdas paziņojumu. Link to comment Share on other sites More sharing options...
marlboro Posted December 6, 2008 Author Report Share Posted December 6, 2008 <sho lapas augspuse kur kipa skripts atrodas!> Notice: Undefined index: lapa in /usr/local/www/apache22/data/tmpl/main.html on line 31 <sho tur kur drukaa ara !> Notice: Undefined offset: 0 in /usr/local/www/apache22/data/tmpl/main.html on line 94 <?php ####################START###################### ini_set("display_errors", true); error_reporting(E_ALL); #######################END#################### 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']; ?> Link to comment Share on other sites More sharing options...
Val Posted December 7, 2008 Report Share Posted December 7, 2008 kristāla bumba īsti nestrādā $saturs_x = (isset($_GET['lapa']) && is_numeric($_GET['lapa'])) ? $_GET['lapa'] : 1; Link to comment Share on other sites More sharing options...
Val Posted December 7, 2008 Report Share Posted December 7, 2008 un kur problēma? Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 Noversu to problemu ar 0 id veljoprojam - Notice: Undefined index: lapa in /usr/local/www/apache22/data/tmpl/main.html on line 31 :( ka lai pareizak vinju nodefineju ? Vel jautajums ka lai tagad uztaisa taa ja id neksiste tad piem izruka ka tada lpp nau ? <?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']; } <<line 31>> $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 if(array_key_exists($atsledzina, $masivins)){//drukajam $masivins[$atsledzina] } else { //drukajam A nava šitādas atsledzinas } Nav pārāk glīti sevi citēt, bet vai šīs rindas patiešām neatbild uz Tavu jautājumu? Patiešām, patiešām? Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 atvainojos bushu laikam ko izlaidis vai sajaucis - tulit proveshu un doshu zinju kaa sanaak! Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /usr/local/www/apache22/data/index.php on line 72 Lapa Netika atrasta! izmet shadu pazinjojumu un to uz visiem id ari tiem kuri eksiste <?php if(array_key_exists($lapu_masivs, $lapa)){; echo $lapu_masivs[$lapa]; } else { echo "Lapa Netika atrasta!"; } ?> Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Man šķiet, ka starp manu: if(array_key_exists($atsledzina, $masivins)){ un Tavu: if(array_key_exists($lapu_masivs, $lapa)){; Ir neliela, bet būtiska atšķirība ;) Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 Man šķiet, ka starp manu: if(array_key_exists($atsledzina, $masivins)){ un Tavu: Ir neliela, bet būtiska atšķirība ;) manam klat ; tas kludas pec bet bez vija ari nejiet... varbut ludzu vari sikak paskaidrot ... Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Parametru secība funkcijai Array_key_exists(). Paskaties, kurš ir kurš manā gadījumā un Tavā. Link to comment Share on other sites More sharing options...
marlboro Posted December 8, 2008 Author Report Share Posted December 8, 2008 SORY ta to4 bij drausmiga neuzmanibas kluda... tagad tik vieniga problema kas man palikusi ir - Notice: Undefined index: lapa in /usr/local/www/apache22/data/index.php on line 64 ka tad lai defineju to Lapa ? Link to comment Share on other sites More sharing options...
Aleksejs Posted December 8, 2008 Report Share Posted December 8, 2008 Ja Tev nav definēts $masivs[$lapa], tad, protams, nedrīksti atsaukties uz šo indeksu ($lapa) masīvā. Lūdzu, atgādini, kāds šobrīd izskatās tas kods, kurā tiek rādīts kļūdas paziņojums. Link to comment Share on other sites More sharing options...
Recommended Posts