Jump to content

need help with sql query...


gtridez

Recommended Posts

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 case
It only returns a result if i type "Myuser" in the form and not "myuser" ...
the colation of the field is latin1_swedish_ci

the 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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.