Anadi Taylor wrote:

> Hi all,
>
> I have written a script that reads in information from a database: name,
> email, password and username.
> I am then searching through this information to match an email address
> entered by a user ( this script is web based ) against the email address
> pulled off the database. This all works fine except (ha ha - there is always
> a BUT !!! ) when I find the email address I am looking for i want to jump to
> the end of the 'while()' loop. I am sure this can be done but I just cant
> figure it out !!!

HI Stefan,

Try using the flag value, $passcheck:

while (!($passcheck) and @dbdata = $sth1->fetchrow_array())

>         {
>                 $dbname         =$dbdata[0];
>                 $dbemail        =$dbdata[1];
>                 $dbpwd          =$dbdata[2];
>                 $dbusrname      =$dbdata[3];
>
>                 ## check to see if emails match
>                 if ($usremail eq $dbemail)
>                 {
>                         $passcheck = "True";
>                         replyTo($usremail, $dbusrname, $dbpwd, $dbname);
>                 }

>         }
>
> Also: the only reason I am having to pull all this data from the mySql
> database is because for some very strange reason mySql doent like the '@'
> and the '.' characters in a sql statement: I actually started with a SQL
> query like:
>
> SELECT name, email, password, username FROM members WHERE
> email='[EMAIL PROTECTED]';
>
> BUT - it really doesnt like this, any ideas why ???

That is really a mySQL problem.  Since the address is passed within single quotes, 
Perl will pass it on as a literal, without attempting to interpolate.  Any hangup 
would therefore occur in the DB engine.  I had no problem offering that syntax to 
Access.

HTH

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to