0

I want do such as this:

$username0 = $_POST["nkn"];
$username1 = strtoupper($username0);
$query = "SELECT username FROM users WHERE strtoupper(username) = '".$username1."'";

What's the right way to do this? Thanks.

user2467899
  • 583
  • 2
  • 6
  • 19

1 Answers1

2

Use the below code:

$query = "SELECT username FROM users WHERE UPPER(username) = '".$username1."'";

In mysql the is the function UPPER() to convert the string in upper case.

Code Lღver
  • 15,573
  • 16
  • 56
  • 75