Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
How to display output of locations
Old 05-02-2009, 09:06 PM How to display output of locations
Average Talker

Posts: 25
Trades: 0
sql = "SELECT FirstName, LastName, Employeeid, ID FROM xyz WHERE location = '5'
order by LastName"

How do I change where it says where location='5' to show all the locations that are in database?
Location
5
6
7
8
9
10

Thank you,
tgmiller5 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-02-2009, 09:42 PM Re: How to display output of locations
itHighway's Avatar
Skilled Talker

Posts: 83
Name: Zeeshan Dar
Location: GUJ
Trades: 0
Simple remove the WHERE clause

Quote:
sql = "SELECT FirstName, LastName, Employeeid, ID FROM xyz
order by LastName"

OR

sql = "SELECT FirstName, LastName, Employeeid, ID FROM xyz WHERE location <> '0'
order by LastName"
__________________
Zeeshan Dar
itHighway -
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
itHighway is offline
Reply With Quote
View Public Profile
 
Old 05-03-2009, 10:14 AM Re: How to display output of locations
Average Talker

Posts: 25
Trades: 0
Thank you but I think I was not clear.

When a user logs in with their username and password, they should only see the list of locations that are assigned to them deriving from the database

For example
Joe logins and should see only location 5 and 6 not all of them from the database.

Right now I am just using the following statement:
select firstname, lastname, employeenumber from xyz where WHERE location = '5' order by lastname

When the user logs in all he/she see is the location of 5 not 6, how can I go about showing the user both the locations they need to see. This also applies to other users that login and need to see their locations such as 10 or 12.



Thanks,
tgmiller5 is offline
Reply With Quote
View Public Profile
 
Old 05-06-2009, 03:25 PM Re: How to display output of locations
Banned

Posts: 4
Name: Cyana
Trades: 0
I did not know that lol this help me to thanks guys
wharro4u is offline
Reply With Quote
View Public Profile
 
Old 05-07-2009, 02:09 PM Re: How to display output of locations
Novice Talker

Posts: 5
Name: John
Trades: 0
You can use IN statement .... like SELECT * FROM TBL WHERE ID IN (1,2)
rams0b is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to display output of locations
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36016 seconds with 12 queries