This topic is locked

Email with table lookup

12/6/2007 9:44:47 AM
PHPRunner General questions
F
funkfish author

Hello everyone,
I want to send an email based on an input, but the input has to be verified against another table.
example:
if $x == "SOMETHING IN ANOTHER TABLE IN COLUMN A"

mail(.......);

else if mail(......);
{

return true;

}
so I need to be able to see if $x is in another table.
Many thanks!

Alexey admin 12/6/2007

Hi,
sure, here is the sample code.

global $conn;

$rs=db_query("select * from AnotherTable",$conn);

$data=db_fetch_array($rs);

if($x==$data["A"])

...

F
funkfish author 12/12/2007

Hi,

sure, here is the sample code.


Thanks, you guys are great!