hello,
im using a PHP class to deal with the queries that my web site needs. The problem im having is that i need to return a mysql_numrows results, but the code i am using will not work.
The code is as follows:
***external php class ********
function checkAddMailing($email)
{
$query = mysql_query("SELECT email FROM mailing WHERE email='$email'") or die(mysql_error());
$rs = mysql_num_rows($query);
return $rs;
}
* mailing page **********
include "external.php";
//make an object of the wrapperclass
$forum=new Interface();
//make db connection
$forumpointer=$forum->connect();
//get records
$rs = $forum->checkAddMailing($email);
//disconnect to db
$forum->Disconnect($forumpointer);
if ($rs !=0) {
}else{
echo "The email address you entered already exists in our mailing list!<br>\n";
}
Hope its something simple, i've overlooked
Thanks for any help in advance