Hi All,

Please help me, I'm new to PHP and MySQL programming
and am really stuck on the attached code. 

I have a Flash front-end and am trying to query my
database for the 'registration' process to see if the
user already has an account. It's a very simple
registration string which compares the users email
address with the entries in the database. If the email
address is already present in the database an error
signal is sent to flash to notify the user. When the
email address is not present it gets added to the
database.

For some reason though it isn't working right and
keeps telling me that the 'Email' address is already
taken even though this entry is non-existant in the
database.

What am I doing wrong with my code below? Is there a
better way to check if the email address is already
contained in the database?

Any help would be much appreciated. Thank you all.

Regards,


Sebastian



_______________________________________

require ("config.inc.php");

$db = mysql_connect($dbserver,$nutzer,$passwort);

$myData = mysql_db_query($dbname,"SELECT * FROM
learningZoneCustomer WHERE Email='$rEmail'");

if ($myData > 0)
{       
        echo 'logInSig=1';

        // error signal for flash to say that email is
already present in the database

}else{
        // if the email address is not present in the
database add it to the database

        mysql_db_query($dbname,"INSERT INTO
learningZoneCustomer(Name,Surname,Email,Area,lChapter,VisitState,LearnState,Score,Date)
VALUES
('$rName','$rSurname','$rEmail','$rArea','$rlChapter','$rVisitState','$rLearnState','$rScore',
CURDATE())");

        $pruf = mysql_affected_rows();

        // Datensatz angelegt (Ja/Nein)

        if ($pruf > 0) {
                echo 'regSig=1';
        }

        
}

______________________________________________


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to