You have two syntax errors in your code.
First you need to use parenthesis when you use &&
in if statemens if((... ) && (...))
if (($newpass == $newpass2) && (strlen($newpass) < 21) && (strlen($newpass) > 5))
Then you need to use single quote while using equal attribute = 'Cleartext-Password'
so your code would look like this
if (($newpass == $newpass2) && (strlen($newpass) < 21) && (strlen($newpass) > 5))
{
$sqlPasswordQuery = "SELECT value FROM radcheck WHERE attribute = 'Cleartext-Password' AND value = '{$oldpass}' AND username = '{$userid}'";