Announcement

Collapse
No announcement yet.

Question about onValidate Event

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about onValidate Event

    Hi to All,

    I have created an authentication system following the template Training. Of course, I had to modify some tables.
    In the event onValidate of login control, I have as part this code:
    Code:
    sc_lookup(ds_user_app, "select tb_groups_x_apps.app_name from tb_groups_x_apps 
    inner join tb_users_x_groups on tb_groups_x_apps.group_id = tb_users_x_groups.group_id where 
    tb_users_x_groups.user_full_name = $glo_username ");
    
    if ({ds_user_app} === false)
    {
    echo "Access error. Message=". {ds_user_app_erro} ;
    }
    elseif (empty({ds_user_app}))
    {
    echo "Select command didn't return data";
    }
    The part of coloured code is used for the test of query and the global variable $glo_username was declared previous.
    When I execute the login control, this error is returned
    Access error. Message=Unknown column 'Admin' in 'where clause'
    I have tried to execute the query in the Toad for mySQL, with this change
    Code:
    SELECT tb_groups_x_apps.app_name
      FROM    tb_groups_x_apps
           INNER JOIN
              tb_users_x_groups
           ON tb_groups_x_apps.group_id = tb_users_x_groups.group_id
     WHERE tb_users_x_groups.user_full_name = 'Admin'
    The query work fine and the list of column app_name is correctly returned.
    Can someone help me ? Have You any idea?
    Last edited by nicosia; 03-13-2013, 07:01 AM.
    Thank You and Best Regards
    Gaetano

  • #2
    Hi Gaetano

    You just have to put quotes around the variable $glo_username like .....user_full_name = '$glo_username' ");
    Giorgio Bravi
    Dolphin Software & Thinkware
    www.dolphin.it

    Comment


    • #3
      Thanks, solved
      Thank You and Best Regards
      Gaetano

      Comment


      • #4
        Hi,
        did you try yet to substiture $glo_username with '$glo_username' ?

        Comment

        Working...
        X