<%=session("username")%>

F

+FarmerPickles

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
 
F

+FarmerPickles

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
 
Q

QuaintCoding

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 thei
name, to view their profile. Then I already have a page written for them t
be able to update their info. But I need to know how to query using th
session name
thank
Ba
 
F

+FarmerPickles

WEll.... now i see that it won't let me change a FP generated item.. is
there a way around this?


QuaintCoding said:
The SQL code that FP generated is already within tags. This means you
don't need the said:
fp_sQry="SELECT * FROM rounds WHERE (username =
' said:
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
choosing the username, I want to
 
F

+FarmerPickles

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
 
F

+FarmerPickles

Why is it, that after I post a question here, I usually figure it out on my
own a few hours or days later. Guess I am still learning as I expected.
Thanks to those who tried to help me.. I apreciate it.
Bam


+FarmerPickles said:
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?



don't need the <%= and %> to put the variable in. So change from this
(what you said didn't work):

temporary variable, then use that variable to computer: click for
them to using
the of
choosing the username, I want to to
know how '::username::')
ORDER BY
 
K

Ken Tolopka

I am having the same sort of problem. Can you tell me how you resolved the issue? Thanks for any help.

Ken

+FarmerPickles said:
Why is it, that after I post a question here, I usually figure it out on my
own a few hours or days later. Guess I am still learning as I expected.
Thanks to those who tried to help me.. I apreciate it.
Bam


+FarmerPickles said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top