Re: [PHP] BASIC function question

2001-04-23 Thread Philip Olson
Looks like you have a scope issue : $a = 'foo'; function bar() { $a = 'bar'; } bar(); print $a; // prints foo outside of the function, $a has not been affected. want it to be? then try something like : $a = 'foo'; function bar() { global $a; $a = 'bar'; } bar();

Re: [PHP] BASIC function question

2001-04-23 Thread David Robley
On Tue, 24 Apr 2001 12:57, Martin Skjöldebrand wrote: > I have a function on an include page that says > > function update_stuff($database) > { > include("includes/connect.inc.php"); > include("config/db.conf.php"); > $query="SELECT * FROM $database"; > $query_res=mysql_query($query, $mysql_link);

[PHP] BASIC function question

2001-04-23 Thread Martin Skjöldebrand
I have a function on an include page that says function update_stuff($database) { include("includes/connect.inc.php"); include("config/db.conf.php"); $query="SELECT * FROM $database"; $query_res=mysql_query($query, $mysql_link); $isequip=mysql_num_rows($query_res); } If I call it from a script a