[thelist] php add email to a mysql db
Andrew Maynes
andrew at uk-webdeveloper.co.uk
Tue Aug 13 09:31:13 CDT 2002
nope, now getting...
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource
in /usr/home/public_html/demo/order2.php on line 12
couldn't execute query
with
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 {
$sql = "INSERT INTO mailinglux(email) VALUES
('$email')";
$result = mysql_query($sql) or die ("couldn't execute query");
if(!EmailOK($email)) {
echo "The email address you submitted is not valid.";
exit;
}
mysql_db_query($dbname, "insert into mailinglux values('','$email')");
}
----------
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