[thelist] php add email to a mysql db

Andrew Maynes andrew at uk-webdeveloper.co.uk
Tue Aug 13 08:52:00 CDT 2002


this 'Parse error: parse error, unexpected T_VARIABLE ' is displayed when I put
this
mysql_error() in and when its out this

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource

is displayed

this is the code


include("settings.inc");

mysql_connect("$dbhost","$dbuser","$dbpass");

$sql = "SELECT email FROM mailinglux WHERE
          email='$email'";
         $result=mysql_query($sql);
         $num=mysql_numrows($result);
         if ($num > 0)
             echo "<center><h3>You are already in our system</h3>";
        else {

mysql_error()

$sql = "INSERT INTO mailinglux(email) VALUES
('$name')";


if(!EmailOK($email)) {

echo "The email address you submitted is not valid.";

exit;
}

mysql_db_query($dbname, "insert into mailinglux values('','$email')");
}


Thank you

Andrew





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02




More information about the thelist mailing list