I am writing a simple login system by using perl( this is almost my first
program in perl), After user pick a username i need to check if this
username already exsited in mysql database table. if it is already in
the table, this program will prompt user to pick another user name.
but something wrong with following code, the program does not work.
[code piece]***************************************
my $selsql="SELECT * FROM apidbusers WHERE username=$username";
#prepare the query for $selsql
my $selsth=$dbh->prepare($selsql);
$selsth->execute();
if($selsth->fetchrow_array()) #*username already in apidbusers
{
print h4("This user name already registerd, please select
another user name.");
regstrForm();
return;
}
***********************************************************************
How to fix this problem?
Any suggesion is appreciated.
J.P.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php