iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old May 26th, 2005, 12:56 AM   #1
New Member
 

Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 TheShadow is on a distinguished road
ASP ADO SQL Query

I'm having trouble thinking how to write a query ... i have two tables customer and contact ...they share a common element of customerID ... their is a login form based on the contactID, contactPassword within the contact table, based on that i want the contactID and customerID of contact, to display the fields of the customer table ...

Anyone keep up with that?
TheShadow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2005, 03:09 AM   #2
WebForumz Admin Badge
 

Join Date: Jul 2003
Posts: 1,848
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 114 Webforumz Staff is on a distinguished road
Code:
SELECT contact.contactID, contact.contactPassword, customer.* FROM contact INNER JOIN customer ON contact.customerID = customer.customerID
Webforumz Staff is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2005, 05:37 AM   #3
New Member
 

Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 TheShadow is on a distinguished road
Isnt that for all Customer ID?

What would you have to do for a particular Customer ID...

TheShadow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2005, 05:44 AM   #4
Reputable Member
 

Join Date: Aug 2003
Location: United Kingdom
Posts: 339
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 D3mon is on a distinguished road
Add:
Code:
where customerID = ...
D3mon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2005, 05:53 AM   #5
New Member
 

Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 TheShadow is on a distinguished road
Quote:
Originally Posted by D3mon
Add:
Code:
where customerID = ...
But thats part of the problem ...

... we input the contactID, and therefore its the corresponding customerID ... but how do we write that?
TheShadow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 26th, 2005, 10:03 AM   #6
WebForumz Member
 

Join Date: Feb 2004
Location: Woodbridge, UK
Age: 28
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Trebz is on a distinguished road
Is it this simple

Code:
SELECT
	Col1,
	Col2,
	etc
FROM contact X
	JOIN customer Y
		ON x.CustomerID = y.CustomerID
WHERE X.ContactID = 'blah'
Trebz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 27th, 2005, 12:34 AM   #7
New Member
 

Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 TheShadow is on a distinguished road
Quote:
Originally Posted by Trebz
Is it this simple

Code:
SELECT
	Col1,
	Col2,
	etc
FROM contact X
	JOIN customer Y
		ON x.CustomerID = y.CustomerID
WHERE X.ContactID = 'blah'
Code:
SELECT *
FROM contact
	JOIN customer
		ON contact.CustomerID = customer.CustomerID
WHERE contact.ContactID = Request.form("username")
... like that?
TheShadow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 27th, 2005, 12:39 AM   #8
New Member
 

Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 TheShadow is on a distinguished road
I guess not ... doesnt return any values ....

TheShadow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 30th, 2005, 06:30 AM   #9
WebForumz Member
 

Join Date: Feb 2004
Location: Woodbridge, UK
Age: 28
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Trebz is on a distinguished road
Could you maybe explain the question a little clearer please, I can't quite understand what you need.

Cheers
Trebz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 30th, 2005, 06:32 AM   #10
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,133
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
I have to say, I'm a little confused too... :S
__________________
Rob - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old June 18th, 2005, 12:12 PM   #11
New Member
 

Join Date: Jun 2005
Location: USA
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 HostBreak is on a distinguished road
Quote:
Originally Posted by rob
I have to say, I'm a little confused too... :S
Me Too!
HostBreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
asp , ado , sql , query


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nav bar query Scottie Your Design and Layout 10 June 9th, 2008 06:23 PM
query about my $query ziggi PHP 9 August 10th, 2007 11:05 AM
MySQL query query dangergeek Databases 3 April 12th, 2007 09:45 AM
SUBSTRING in query contiw Databases 0 October 11th, 2006 04:23 PM
Query accessman Databases 0 September 22nd, 2005 04:48 PM


Search Engine Optimization by vBSEO 3.2.0 RC8