Re: [PHP] How do I access a local variable?

2009-04-19 Thread Ashley Sheridan
On Sun, 2009-04-19 at 21:55 -0400, Paul M Foster wrote: > On Mon, Apr 20, 2009 at 12:54:27AM +0100, abdulazeez alugo wrote: > > > > > Hi guys, > > > > I have a function inside which I set alocal variable to store a result. Can > > I access this variable in another function? if yes then how? > >

Re: [PHP] How do I access a local variable?

2009-04-19 Thread Paul M Foster
On Mon, Apr 20, 2009 at 12:54:27AM +0100, abdulazeez alugo wrote: > > Hi guys, > > I have a function inside which I set alocal variable to store a result. Can I > access this variable in another function? if yes then how? > > function tbl1($entrytitle, $entrytext) > > { > > global $conn; >

Re: [PHP] How do I access a local variable?

2009-04-19 Thread Chris
abdulazeez alugo wrote: Hi guys, I have a function inside which I set alocal variable to store a result. Can I access this variable in another function? if yes then how? No, you can't. You either need to pass it back (recommended) or make it global (not recommended). function tbl1($entryt

[PHP] How do I access a local variable?

2009-04-19 Thread abdulazeez alugo
Hi guys, I have a function inside which I set alocal variable to store a result. Can I access this variable in another function? if yes then how? function tbl1($entrytitle, $entrytext) { global $conn; $result= mysql_query("INSERT INTO tbl1(tbl1_id, title, text) VALUES('NULL', '$entryti