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();
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);
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
3 matches
Mail list logo