gtridez Posted August 30, 2006 Share Posted August 30, 2006 hey...i'm tryin to query something in a mysql table ...i'm searchin a table to find a username where the user name is "Myuser" ...ie the first letter is upper caseIt only returns a result if i type "Myuser" in the form and not "myuser" ...the colation of the field is latin1_swedish_cithe code is as below...any help will be greatly appreciated...thanx[code]include("includes/connect_gtriderz.php"); $sql = "SELECT * FROM members WHERE username='$username'"; $query = mysql_query($sql); while ($row = mysql_fetch_array($query)) { $dbUser = $row['username']; if($dbUser == $username) { $errmsg = "We're sorry but the username <b><i>$username</i></b> already exists, please use another one ..."; $error = "yes"; $username = ''; } } include("includes/closeDb.php");[/code] Quote Link to comment Share on other sites More sharing options...
gtridez Posted August 30, 2006 Author Share Posted August 30, 2006 hey never mind guys ...i figured it out...i stripped both of the values to lowercase using strtolower before comparing them...[code]$value1 = strtolower($originaltext);$value2 = strtolower($dbtext);[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.