Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Query dosen't work

    hi friends i have a question
    i make this on application.cfm

    <cfapplication sessionmanagement="yes"
    name="UniqueName"
    ClientManagement="No"
    SessionTimeout="#CreateTimeSpan(0,0,30,0)#"
    SetClientCookies="Yes">

    <cflogin>
    <cfif IsDefined('FORM.submit')>
    <CFQUERY NAME="qLogin" DATASOURCE="myaccount">
    <!--- Select NombreUsuario, Clave, IdUsuario
    FROM dbo.ClientesMyAccount, dbo.Usuarios
    WHERE dbo.ClientesMyAccount.Id_Cliente = dbo.Usuarios.IdUsuario
    AND dbo.Usuarios.NombreUsuario = '#FORM.username#'
    AND dbo.Usuarios.Clave = '#FORM.password#' --->
    SELECT NombreUsuario, Clave, IdUsuario, Fkcliente
    FROM dbo.ClientesMyAccount INNER JOIN dbo.Usuarios ON
    (dbo.ClientesMyAccount.Id_Cliente = dbo.Usuarios.FkCliente)
    WHERE dbo.Usuarios.IdUsuario = dbo.Usuarios.IdUsuario
    AND dbo.Usuarios.NombreUsuario = '#FORM.username#'
    AND dbo.Usuarios.Clave = '#FORM.password#'
    </cfquery>

    <CFQUERY NAME="clientes" DATASOURCE="myaccount">
    Select *
    from dbo.ClientesMyAccount, dbo.Usuarios
    where dbo.Usuarios.FkCliente = dbo.ClientesMyAccount.Id_Cliente
    </CFQUERY>

    <cfif qLogin.RecordCount GT 0>
    <cfloginuser name="#qLogin.idusuario#" password="#FORM.password#"
    roles="#qLogin.fkcliente#" />
    <cfelse>
    <cfset sHeaderMessage = "The email and password combination you tried is
    incorrect."/>
    <cfinclude template="login.cfm" />
    <cfabort />
    </cfif>
    <cfelse>
    <cfinclude template="login.cfm" />
    <cfabort />
    </cfif>
    </cflogin>

    then on the index.cfm
    i make this query

    <cfif isDefined("qLogin.idusuario")>
    <CFQUERY NAME="cuenta" DATASOURCE="myaccount">
    SELECT TOP 100 Llamadas.NumeroOrigen, Llamadas.NumeroDestino,
    Llamadas.Starttime, Llamadas.Fecha, Llamadas.CostoLlamada, Llamadas.Codigo,
    Llamadas.Destino, Llamadas.Tarifa, Llamadas.FkCliente, Usuarios.FkCliente AS
    Expr1
    FROM Llamadas INNER JOIN
    Usuarios ON Llamadas.FkCliente = Usuarios.FkCliente AND Llamadas.FkCliente =
    Usuarios.FkCliente
    AND Llamadas.FkCLiente = '#qLogin.idusuario#'
    ORDER BY Llamadas.Fecha DESC
    </cfquery>
    </cfif>


    but it retunrs in blank space

    i make a login site but when the persone validate it
    the query dont returns the data to the rich form can somebody helpme please
    i have a specic id for the table so in any case 1 person can only se an
    specific information
    i use FKCliente for the type of member, here is the rows view
    [url]http://img229.imageshack.us/img229/3900/row6rf.jpg[/url]

    gcmenotti Guest

  2. Similar Questions and Discussions

    1. DreamWeaver behavior dosen't work for flash player 8
      Hi, I'd use to control my .swfs with the dreamweaver behavior (control shockwave or flash), but since i did download the flashplayer8 the .swf do...
    2. Query use to work on CF 4.5
      I'm getting the following error "No value given for one or more required parameters." However this worked on CF 4.5 but not on CF 6.1. Any ideas? ...
    3. getopt from iiug ftp site dosen't work
      Hi! I'm running: $ c4gl -V INFORMIX-4GL Version 7.30.UC5 Software Serial Number XXX#XXXXXX on HPUX 10.20. I downloaded...
    4. Flash movie dosen't preview in browser?
      I have a small flash movie that dosen't preview in either of the browers I use. If I click on the "play" button it plays just fine. What is not...
    5. XP Pro Dosen't remember passwords
      Scotty; Try this: http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B264672 -- Jupiter Jones An easier way to read newsgroup...
  3. #2

    Default Re: Query doesn't work

    You don't have a where clause

    change this
    FROM Llamadas INNER JOIN
    Usuarios ON Llamadas.FkCliente = Usuarios.FkCliente AND Llamadas.FkCliente =
    Usuarios.FkCliente
    AND Llamadas.FkCLiente = '#qLogin.idusuario#'

    to
    FROM Llamadas INNER JOIN
    Usuarios ON Llamadas.FkCliente = Usuarios.FkCliente
    /*
    this part is redundant, get rid of it
    AND Llamadas.FkCliente = Usuarios.FkCliente
    /*
    -- change and to where
    where Llamadas.FkCLiente = '#qLogin.idusuario#'


    Dan Bracuk Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139