4 Replies Latest reply on Oct 9, 2007 3:52 AM by JohnGree

    SQL username field

    JohnGree Level 1
      Hi i have a SQL database with a login table

      i am using the username as the email address, but when the email is name.surname.com.edu.net.au

      my login script throws back username not found, but if i login with name.surname.com it logs in fine so the .edu.net.au

      do i have to change the varchar username to something else?
        • 1. Re: SQL username field
          Level 7
          JohnGree wrote:
          > Hi i have a SQL database with a login table
          >
          > i am using the username as the email address, but when the email is
          > name.surname.com.edu.net.au
          >
          > my login script throws back username not found
          >
          > do i have to change the varchar username to something else?
          >

          no, but you probably have to change something else...
          posting some code may help you get an answer...


          --

          Azadi Saryev
          Sabai-dee.com
          http://www.sabai-dee.com
          • 2. SQL username field
            JohnGree Level 1
            ok i am using a stored procedure.

            <cfstoredproc procedure="xsp_GetSchoolEmailUser" datasource="#application.ds#">
            <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="username" value="#username#" null="No">
            <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="password" value="#password#" null="No">
            <cfprocresult name="qGetUser" resultset="1">
            </cfstoredproc>

            i have tested the stored procedure on sql and it works fine?
            • 3. Re: SQL username field
              Level 7
              JohnGree wrote:
              > ok i am using a stored procedure.
              >
              > <cfstoredproc procedure="xsp_GetSchoolEmailUser" datasource="#application.ds#">
              > <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="username"
              > value="#username#" null="No">
              > <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="password"
              > value="#password#" null="No">
              > <cfprocresult name="qGetUser" resultset="1">
              > </cfstoredproc>
              >

              looks ok to me....

              a) many RDBMS do not like names like 'username' and 'password' for
              anything but their internal controls...
              b) cf sometimes may not like those names as variable names, too,
              especially if the tag may accept username and password attributes (like
              cfstoredproc does)
              c) if the values you pass to your sp come from a form, make sure you
              scope them: i.e. #form.username#
              d) did you try running the query inside your rdbms? does it actually
              return any data at all?

              --

              Azadi Saryev
              Sabai-dee.com
              http://www.sabai-dee.com
              • 4. SQL username field
                JohnGree Level 1
                ok thanks

                i have changed my procedure to below, and i still get the same problem, any ideas why this email address firstname.surname@det.nsw works and this one firstname.surname@det.nsw.edu.au does not?

                i have them both workiing when i actually run the procedure inside sql?


                <cfstoredproc procedure="xsp_Login" datasource="#application.ds#">
                <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="LoginEmail" value="#FORM.LoginEmail#" null="No">
                <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="LoginPassword" value="#FORM.LoginPassword#" null="No">
                <cfprocresult name="qVerify" resultset="1">
                </cfstoredproc>