[thelist] SQL help

Ken Schaefer Ken at adOpenStatic.com
Fri Jan 21 03:59:55 CST 2005


I don't think so. You should get an error indicating that the fields id and
username are ambiguous.

If a record has the same id and username in both tables, things would be a
little simplified, otherwise, you can do something like;

SELECT
	1
FROM
	tblStaff AS a
	, tblStudents AS b
WHERE
	a.username = '$username'
OR
	b.username = '$username'

which would give you an EOF or a 1

Cheers
Ken

: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Tim Burgan
: Sent: Friday, 21 January 2005 6:11 PM
: To: [thelist] thelist at lists.evolt.org
: Subject: [thelist] SQL help
: 
: hello
: 
: is this the correct SQL to seach if a username already exist across two
: tables, both containing id (unique number) and username (unique string)
: fields?
: 
: 
: SELECT id
: FROM tblStaff, tbl Students
: WHERE username = '$username';
: 
: 
: if the username does NOT exist the recordset will return EOF (End of
: File). Is this correct?
: 
: tim
: 
: 
: 
: 
: --
: 
: * * Please support the community that supports you.  * *
: http://evolt.org/help_support_evolt/
: 
: For unsubscribe and other options, including the Tip Harvester
: and archives of thelist go to: http://lists.evolt.org
: Workers of the Web, evolt !


More information about the thelist mailing list