MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 2nd, 2004, 05:43 AM
paulcommand paulcommand is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 6 paulcommand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 29 sec
Reputation Power: 0
MySQL problem with ASP (about session) (sql query)

Hello I'm paul. From Thailand.

I used to use Access with ASP. Now, I turn to MySQL for better database.
It's working well. Until now I have problem with query MySQL.
I have to use session("ID") that keep ID value of user who login.
Yes, after login session("ID") will hold value such as 1.

conn.Open "driver="&mysql&";Server="&servers&";Database="&database&";UID="&user&";Pwd="&password&"; option=3;"
sql="select * from ad where ID="&session("ID")
set rs = server.createobject("ADODB.RecordSet")
rs.cursorlocation = 3
rs.Open sql,conn,1,3

The Error Line is line 2
I try to change to this...

ID=session("ID")
conn.Open "driver="&mysql&";Server="&servers&";Database="&database&";UID="&user&";Pwd="&password&"; option=3;"
sql="select * from ad where ID="&ID

It error too
But when I try this.......

ID=1
conn.Open "driver="&mysql&";Server="&servers&";Database="&database&";UID="&user&";Pwd="&password&"; option=3;"
sql="select * from ad where ID="&ID


It's no problem
But the problem is I have to chage ID to be the ID of user who loged in.
So I have to use session("ID")
Please Help How to do this case

Reply With Quote
  #2  
Old September 9th, 2004, 11:17 AM
ccbangler ccbangler is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 ccbangler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Does the session("id") have the right information?

Do quick check to make sure your session ID is set correctly or exists. It should work in either way you have it there. &Session("ID") or ID = Session("ID") ( I prefer the variable way, seems less troublesome)
I can't see anything wrong with the syntax (but then again I am a only a basic scripter!)

Reply With Quote
  #3  
Old September 25th, 2004, 07:46 AM
fasil_ak fasil_ak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 fasil_ak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I have also faced the same problem but i came out of it

Just change the query in the following format

sql="select * from ad where ID="&cstr(session("ID"))

Just had the cstr() method to the session id

Thats it

Fasil

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL problem with ASP (about session) (sql query)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway