SQL help
| From: | Russ Michell | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | SQL help | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-8425@lists.php.net to get a copy of this message | ||
Hi there folks, I have a small prob regarding SQL on MySQL 3.22.32
using php4.0.3pl1 :
I want to select DISTINCT sports from one table WHERE a username and a
password match a username and a password in another table - not sure
how to construct my query.
In an ideal world it's gonna look something like this:
$sql = "SELECT DISTINCT sportID FROM $table_sport";
$sql .= "SELECT * FROM $table_users WHERE $table_users.usrName='$admin_username'
AND $table_users.usrPswd=password('$admin_password')";
Just not sure how the query needs to be constructed...
Can anyone with even slightly advanced (over me) SQL knowledge help me
out??
Many thanks!
Russ
#-------------------------------------------------------#
"Believe nothing - consider everything"
"Web Developers do it on-the-fly."
Russ Michell
Anglia Polytechnic University Webteam
www.apu.ac.uk/webteam
r.j.michell@apu.ac.uk
+44 (0)1223 363271 ext 2331
www.theruss.com
#-------------------------------------------------------#