Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jun 2010
    Location
    Earth
    Posts
    305
    Thanks
    27
    Thanked 2 Times in 2 Posts

    case sensitivity

    SCRATCH THIS

    I figured out what my issue was, all started with the login page, now that I've fixed that this issue is moot.




    I have this code which seem to be case sensitive but I do not want it to be. However I cannot figure out why it is can
    someone help?


    Say a userName is 'junk' and they log in as 'JUNK' then the code below does not see that 'junk' == 'JUNK'


    PHP Code:
    $sql2 "SELECT * FROM nudges WHERE sender='$clientID' AND receiver ='$userID' UNION SELECT * FROM nudges WHERE sender='$userID' AND receiver ='$clientID'";
    $result2 $mysqli->query($sql2);
    $num_rows $result2->num_rows;

    while (
    $r=$result2->fetch_assoc()) {
        
    $sender=$r["sender"];                                
    }

    if(
    $num_rows == 1){
        echo 
    "<span class='links'><img src='img/group_go2.png'> </span>
        <div id='linkboxUserIDNudged'>"
    ;
        if (
    $clientID != $sender){
            echo 
    "<a href='myNudges.php'>Nudged</a></div>    ";
        }
        else {
            echo 
    "<a href='sentNudges.php'>Nudged</a></div>    ";
        }


    However this statement doesn't seem to make that comparison

    PHP Code:
    $sql ="SELECT * FROM threads WHERE receiver='$clientID' OR ( sender='$clientID' AND replies >=1 ) ORDER BY lastDate DESC";
    $result $mysqli->query($sql);
    while(
    $r $result->fetch_assoc()) {
        
    $sender=$r['sender'];
        
    $receiver=$r['receiver'];
        
    $replies=$r['replies'];

        if(
    $clientID == $sender){ 
    Last edited by harkly; 07-27-2012 at 08:04 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •