Why oh Why????
| From: | WMB | Date: | Thu, 16 Jan 2003 09:17:06 +0000 |
| Subject: | Why oh Why???? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-131831@lists.php.net to get a copy of this message | ||
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