Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
shen jiayu
Courses Plus Student 1,063 Pointsabout the case sensitivity of PHP
i have my users table which is created in the databases.for example one user 'jason' registered as this username after 'Jason' login with one single or multiple uppercase due to the insensitive of PHP...however the $_COOKIE['uname'] is stored as Jason...that leads to a few problems....such as deleting the status which is created by 'jason' not 'Jason'
1 Answer
justinliang
6,948 Pointsyou could use strtolower function in your sql query, like that:
'''PHP
$result = mysql_query("
SELECT *
FROM example_orders
WHERE LOWER(buyer_email) = '" . strtolower($useremail) . "';
") or die(mysql_error());
shen jiayu
Courses Plus Student 1,063 Pointsshen jiayu
Courses Plus Student 1,063 Pointsi figured it out....query the database before setting the cookies .~~~anyway ...thx