Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
php varijable :O

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 01.10.2004 22:00    Post subject: php varijable :O Add user to your forum ignore list Reply with quote

znači imam funkciju koja fetcha neš iz mysql db i uglavnom želim taj rezultat korist i izvan te funkcije...(ili su te var. i inače "dostupne" ostaku programa ?? )


malo glupo pitanje Embarassed

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 01.10.2004 22:11    Post subject: Add user to your forum ignore list Reply with quote

ovak, postoji 4 nacina na koji mozes varijabli unutar funkcije dodjeliti vrijednost te je koristiti izvan funkcije.

sa definicijom (konstanta, sto je prakticki beskorisno) Smile
sa globalnom varijablom
sa adresnim operatorom
sa povratnom vrijednosti funkcije

ajd daj funkciju na pregled pa da ti odma damo rjesenje jer cu napisati x primjera..
Back to top
View user's profile Send private message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 01.10.2004 22:16    Post subject: Add user to your forum ignore list Reply with quote

maxy wrote:

sa globalnom varijablom


to bi bilo to pretpostavljam Smile

Code:
function kokos(){
global $pas;
$pas = "mis";
}
kokos();
print $pas;

ak sam dobro shvatio to je to??? to isto tak radi s poljima ..

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 01.10.2004 22:24    Post subject: Add user to your forum ignore list Reply with quote

da, ali mozes to i ovako:

function baka(&$deda, $unuk) {
$unuk .= 'nije';
$deda = 'mihalj';
return $unuk;
}

$unuk = 'nije';
$unuk = baka(&$deda, $unuk);

sad imas 2 varijable:
$deda i povratnu vrijednost funkcije (ono kaj je u return jelte).
Back to top
View user's profile Send private message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 01.10.2004 22:28    Post subject: Add user to your forum ignore list Reply with quote

& ? Smile

mse čini da mi je izbacivao neku grešku kad bi napravio nešto slično s array tj. fetchom Smile

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 01.10.2004 22:31    Post subject: Add user to your forum ignore list Reply with quote

mozes dat tu konkretnu funkciju na uvid?
Back to top
View user's profile Send private message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 01.10.2004 23:05    Post subject: Add user to your forum ignore list Reply with quote

never mind sad radi Smile

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group