Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Tablice, problem z odpowiednim wypelnianiem, help
gutek84
post
Post #1





Grupa: Zarejestrowani
Postów: 116
Pomógł: 4
Dołączył: 9.10.2007
Skąd: Morąg

Ostrzeżenie: (0%)
-----


Witam!

Mam dwie tablice inv i set. Problem mam z tablica set. Zamiast dopisywac to nadpisuje mi wartosci. Ponizej zamieszczam cały kod. Od zaznaczenia zaczyna sie moj problem. Prosze o pomoc. 
pozdr
  1. <?php
  2. $date2=getdate();
  3. $date = $date2["year"]."-".$date2["mon"]."-".$date2["mday"] ;
  4. $nullb=array();
  5. $nulle=array();
  6. $inv_item2=array();
  7. $null=mysql_query("select i.i_barcode from ivt.d_inventar i where i.i_id not in (select i.i_id from ivt.d_inventar i, ivt.d_rent r where i.i_id=r.r_inventor
    i
  8.  and r.r_realgetbackdate is null);");
  9. while($nulla=mysql_fetch_array($null,MYSQL_ASSOC)){
  10. array_push($nullb,$nulla);
  11. }
  12. $barcode=$_GET['barcode'];
  13.  
  14. if($barcode{0}==1){
  15. $nullc=mysql_query("select i.i_barcode from ivt.d_inventar i, ivt.d_set r, ivt.c_invset c where
     r.s_
  16. arcode='".$barcode."' and i.i_id=c.c_inventarid and r.s_id=c.c_setid;");
  17. while($nulld=mysql_fetch_array($nullc,MYSQL_ASSOC)) {if($nulld!='') 
  18. array_push($nulle,$nulld);}
  19. --------------------------------------------------------
  20.  
  21. foreach($nulle as $v){
  22.  $set[]=$barcode;
  23. foreach($v as $vv)
  24. $inv[]=$vv;
  25. }
  26. }
  27.  
  28. foreach($nullb as $v){
  29. foreach($v as $vv){
  30. if ($vv==$barcode) $zm=1;
  31. }
  32. }
  33.  
  34.  
  35. if ($zm==1){
  36. if(isset($barcode)){
  37. if(count($inv)==0)
  38. $inv[]=$barcode;
  39. if(count($inv)!=0)
  40. foreach($inv as $v){
  41. if($v==$barcode)$barcode="";
  42. }
  43. if($barcode!='') {
  44. $inv[]=$barcode;
  45. }
  46. }}
  47. -------------------------------------------------------------------
  48. ?>


Ten post edytował gutek84 17.01.2008, 22:56:47
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 21:11