Gu6ax Posted January 9, 2007 Report Share Posted January 9, 2007 Tātad izsaucu funkciju select($tab2,$tab,$db) mēginu izvadīt $rs.. bet tas netiek attēlots! :| why..? Funkcija: function select($tab2,$tab,$db){ foreach ($tab2 as $v){ $izv3.=$v ; } $rs=$db->executeQuery("SELECT $izv3 FROM $tab"); } Link to comment Share on other sites More sharing options...
andrisp Posted January 9, 2007 Report Share Posted January 9, 2007 Neredzu nekur echo vai print. Pat ne return, kas varētu atgriezt $rs kādam echo vai print ārpus tevis iepostētā koda. Link to comment Share on other sites More sharing options...
Stopp Posted January 9, 2007 Report Share Posted January 9, 2007 Ja tu definē mainīgo iekš funkcijas, tad tas tur arī paliek un ārpus funkcijas nav aiztiekams. Ja gribi izvadīt, tad liec return iekš funkcijas un tad kur vajag liec echo funkcijas_nosaukums(); Link to comment Share on other sites More sharing options...
Gu6ax Posted January 9, 2007 Author Report Share Posted January 9, 2007 Andrisp - funkcijas izsaukšana un ... $db=new Database("datubaze"); $tab2=array("virsraksts," , "txt"); $tab='jaunumi'; select($tab2,$tab,$db); print_r($rs); Link to comment Share on other sites More sharing options...
andrisp Posted January 9, 2007 Report Share Posted January 9, 2007 Kā jau Stopp teica, tad iekš fjas definēts mainīgais ārpus šīs fjas vairs nav redzams. Link to comment Share on other sites More sharing options...
Gu6ax Posted January 9, 2007 Author Report Share Posted January 9, 2007 Liels paldies! :) Link to comment Share on other sites More sharing options...
cucumber Posted January 10, 2007 Report Share Posted January 10, 2007 Es nedomaju ka uzreizs vajadzetu kerties klassem, ja pat nezin ka atgriezt f-jas vertibu. Link to comment Share on other sites More sharing options...
Recommended Posts