MySQL Forums
Forum List  »  Newbie

Updating records w/PHP
Posted by: adspam
Date: May 02, 2005 09:21PM

Hi,

I've set up a mailing list form at http://www.coeart.us/mailing.php that adds the user's info to my MySQL db just fine. It then sends out a 'click on the link to verify' email.

Everything working fine up until that point.

However, once the user clicks on the link they're sent in their verification email, the page they're taken to (mailing_email.php) returns the "Sorry! You have either already verified your email..." error message.

When I examine the db, I see that the value for the 'active' field hasn't been changed from '0' to '1' either (0=not confirmed/email doesn't exist in db, 1=confirmed/email address exists in db) as it should be once the email address has been confirmed.

The code on the this page is as follows (not including the connection code):


<?php mysql_select_db($database_conn_coeart, $conn_coeart); ?>
<?php $email=$_GET[vmail]; ?>
<?php $query="update coeart_newsltr set active=1 where email='" . $email . "'"; ?>
<?php $result=mysql_query($query); ?>
<?php
if(mysql_affected_rows()>0)
{
echo "<h1>Congratulations!</h1>";
echo "<p>Your email has been verified.</p>";
}
else
{
echo "<p>Sorry! You have either already verified your email, or you haven't submitted your details for verification. Please resubmit your details.</p>";
}
?>

What could I be missing? Or does anyone have a better alternative to updating/changing the field?

Any help so very appreciated...

Thx.

Options: ReplyQuote


Subject
Written By
Posted
Updating records w/PHP
May 02, 2005 09:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.