Ok. I tried to make a query using what you stated.
SELECT * FROM rounds WHERE (username = session("username"))
and got this
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'session' in
expression.
So i did this tempUsrName = session("username")
then changed the query to this
SELECT * FROM rounds WHERE (username = tempUsrName)
but neither will work. the second gave me an error on the page itself:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Expected 1.
Number: -2147217904 (0x80040E10)
Source: Microsoft OLE DB Provider for ODBC Drivers
so I am not sure where to go from here. this is the first time I have ever
tried to use the session info in a query, and I am still lost.
Jeff
+FarmerPickles said:
WEll.... now i see that it won't let me change a FP generated item.. is
there a way around this?
The SQL code that FP generated is already within tags. This means you
don't need the <%= and %> to put the variable in. So change from this
(what you said didn't work):
fp_sQry="SELECT * FROM rounds WHERE (username =
'<%=session("username")%>)
ORDER BY username ASC"
to this:
fp_sQry="SELECT * FROM rounds WHERE (username = session("username"))
ORDER BY username ASC"
It might also be good to assign the value of session("username") to a
temporary variable, then use that variable to computer:
tempUsrName = session("username")
fp_sQry="SELECT * FROM rounds WHERE (username = tempUsrName)
ORDER BY username ASC"
Either of those should work.
----- +FarmerPickles wrote: -----
Basically what I want to do, it when someone logs on, they can click
their
name, to view their profile. Then I already have a page written for
them to
be able to update their info. But I need to know how to query using
the
session name.
thanks
Bam
How can I fit this into a FP generated query?
<%=session("username")%>>> FP creates the one below, but instead of
choosing the username, I want to
to
select the person that is logged on.
I realize I wouldn't need the ORDER BY anymore. BUt just want to
know how
to
put this variable in the query
fp_sQry="SELECT * FROM rounds WHERE (username = '::username::')
ORDER BY
username ASC"
this didn't work:
fp_sQry="SELECT * FROM rounds WHERE (username =
'<%=session("username")%>)
ORDER BY username ASC" it ended the asp coding
Thanks