>>>> where passcode='" . $passcode "'") <<< looks like you need a period after $passcode
Regards http://kennethtucker.com --- In [email protected], "fredbird67" <[EMAIL PROTECTED]> wrote: > > I'm trying to add a prayer E-mail list to my church's website and have > run into a brick wall as I was trying to add my own E-mail address to > the database where all that info is stored. > > The command it's complaining about is as follows: > $sql = "select * from maillist where plmail='" . $plmail . "' and > where passcode='" . $passcode "'") or die("SELECT Error: " . > mysql_error() . " in Query: $sql"; > > For the record, this is the next-to-last line on here, which is > appearing indented in this box. This snippet of code is part of a > block that executes if someone is trying to remove their E-mail > address from the list. > > I've included quite a few lines before this too and have only posted > the possible suspects and eliminated everything that works properly. > I've tried several things with this, and quite frankly, I'm stumped. > > If anyone knows why this is happening, I'd really like to know. Thanx! > > Fred > > <begin code> > > $passcode = rand(0,16777216); > > if ($action) { // action=1 is to subscribe, action=0 is to delete > include("dblogin.php"); > > $select = mysql_select_db("wcc") or die("Sorry -- I cannot connect to > the database because " . mysql_error()); > $insert = "insert into maillist (plname, plmail, passcode, active, > staff) > values ('$_POST[plname]','$_POST[plmail]','$_POST[passcode]',0,0)"; > $rs = mysql_query($insert, $conn) or die("Sorry -- I cannot run the > query because " . mysql_error()); > > if(!mysql_error()) { > // No error > $tbody="Dear " . $name . ".\r\n\r\n"; > $tbody.="To officially add yourself to the prayer list, please <a > href=\"http://www.westportchurch.com/confirm.php?plmail=\" . $plmail . > \"&passcode=\" . $passcode . \"&action=1\>click here</a>."; > > $headers="From: \"Your name\" <Your email>"; > $subject="We're almost done with the verification process..."; > > mail($email, $subject, $tbody, $headers); > } > } > > else { > include("dblogin.php"); > > $select = mysql_select_db("wcc") or die("Sorry -- I cannot connect to > the database because " . mysql_error()); > > <this is what it doesn't like> > $sql = "select * from maillist where plmail='" . $plmail . "' and > where passcode='" . $passcode "'") or die("SELECT Error: " . > mysql_error() . " in Query: $sql"; > </this is what it doesn't like> > > $rs = mysql_query($sql, $conn) or die("Sorry -- I cannot run the > query because " . mysql_error()); > ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income homes are not online. Make a difference this holiday season! http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/HKFolB/TM --------------------------------------------------------------------~-> Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
