Fork me on GitHub

user table update problem  Bottom

  • Hi every one this might sound simple but I have been fighting with it all day. I am working with LDAP and the ldapAuth module wich I have for the most part rewriten to work with encrypted passowords and a few other things. now all I want to add is when a user logs in (all user log in through LDAP) it gets all the LDAP user data such as ICQ, Yahoo, bio, etc.. any way the only thing that is not wroking form me is updating the user table so here is my code

    Code

    $myUid= "30";
    $myBio= "I went to school once bla bla bla bla";    
    $userscolumn = $pntable['users_column'];
    $userstable = $pntable['users'];


            $sql = "UPDATE $userstable
                    SET  $userscolumn[bio] = "
    . pnVarPrepForStore($myBio) . "
                    WHERE $userscolumn[uid] = "
    . pnVarPrepForStore($myUid) . ";
                             
           
            $dbconn->Execute($sql);


    I use a simillar SQL call to initially add the user to mysql and it works fine. but with this I get no error but the data does not get added. I have not been able to find a example of how to better do this. any help would be great.

    dave
  • Looks like you need single quotes around the pnVarPrepForStore($myBio).
  • Actually the $SQL line should be:

    Code

    $sql = "UPDATE $userstable SET  $userscolumn[bio] = " . pnVarPrepForStore($myBio) . " WHERE $userscolumn[uid] = " . pnVarPrepForStore($myUid);


    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...

This list is based on users active over the last 60 minutes.