ECoode
08-11-2012, 08:12 AM
Hey guys I just started to learn PHP PDO and I'm kinda lost with it.
Well practice makes perfect...
I'm trying to check is there row in the database with checking is there id..
There is form with text field for $Nickname
Code:
$SQL = "SELECT id FROM users WHERE nickname = '$Nickname'";
if( $STMT = $DBH->exec( $SQL ) == "1" ){
echo "OK";
}else{
echo "NO";
}
Even tough database has 'ECode' nickname field and I submit it;
always returns with 'NO'.
Thanks already for helping me :)
Well practice makes perfect...
I'm trying to check is there row in the database with checking is there id..
There is form with text field for $Nickname
Code:
$SQL = "SELECT id FROM users WHERE nickname = '$Nickname'";
if( $STMT = $DBH->exec( $SQL ) == "1" ){
echo "OK";
}else{
echo "NO";
}
Even tough database has 'ECode' nickname field and I submit it;
always returns with 'NO'.
Thanks already for helping me :)