As a beginner I have been trying and trying, but to no suc6. Hope there's someone here able to help me out:
Am trying to get rid of spaces and change all into uppercase in an entered form variable, which I am able to do when trying things out but when running the full php statement it refuses to change and enters the original variable into the database anyway. Haven't got a clue why. Please, what's wrong with the following: if(mysql_result($query, 0, 0) == 0)// && (mysql_result($query2) > 0)#) { $password = md5($_POST['strPassword']); $newstrUserName = $_POST['strUsername']; $newstrUserName = strtoupper(ereg_replace(" ", "", $newstrUserName)); $strQuery = "INSERT INTO users ("; $strQuery .= "`username`, `password`, `level`, `firstname`, `lastname`, `ngfnummer`, `email`) VALUES ("; $strQuery .= "'$newstrUserName', '$password', '1', '{$_POST['strFirstName']}', '{$_POST['strLastName']}', '{$_POST['strNgfnummer']}', '{$_POST['strEmail']}')"; if(mysql_query($strQuery)) etc etc etc original username given f.i. 'joe 8', $newstrUserName makes this 'JOE8', but the above still enters 'joe 8' into database, how come????? Thanks, Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php