[ale] [OT] need help with 2 simple lines of php

ChangingLINKS.com x3 at ChangingLINKS.com
Thu Apr 10 14:05:05 EDT 2003


This may be of some interest to you admin/php programmers out there - insofar 
as trying to reduce the amount of unwanted email on the Internet. I am trying 
to create a filter so that I don't send email to people who don't want it. 
The problem is that IANAP, and I have been beating my head against the wall 
on what seeeeems like a veeeerry simple process.

<?php
connect to database
select a record
set variable $res that counts number of rows
	if( mysql_num_rows( $res ) > 0 )
	{
	$set variables for information in columns
	include ("file with function that alters records");
	call the function
		the function sets a variable $sendemail "yes" or "no"
	{
	if( $sendemail == "yes" )
	{
	echo "$sendemail";
	}
  }
?>

The problem is that no matter what I do in the function (which works) the 
calling script does NOT recognize the results of the function. The calling 
script can only see the state the database was in before calling the 
function.

Why?

Can't a function in another file set a variable that is recognized by the 
calling script? If not, how come the calling script does not recognize the 
update to the database either?

Can someone help me write the 2 *working* lines that will recognize the work 
of the function?
(I tried removing the { before the second if and the } after the last 
$sendemail)

-- 
Wishing you Happiness, Joy and Laughter,
Drew Brown
http://www.ChangingLINKS.com
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list