Renato Golin schreef:
[EMAIL PROTECTED] wrote:
How do I check two tables is it? Username and userpass are submitted through a from and are unique

$sql = "SELECT username, userpass FROM mytable, mytable2 WHERE username = '$username' AND userpass = '$userpass'";

This way you'll have an ambiguous error as username and userpass belongs to both table (as far as I could understand). You can do both selects or do something like this:

select a.user, a.pass, b.user, b.pass
from table1 a, table2 b
where (...)

Or create a MERGE storage engine if both your tables are identical:

http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html

cheers,
--renato

Or if your tables are not identical you can use a LEFT JOIN:
http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php

Mike

--
Medusa, Media Usage Advice B.V.
Science Park Eindhoven 5216
5692 EG SON
tel: 040-24 57 024 fax: 040-29 63 567
url: www.medusa.nl
mail: [EMAIL PROTECTED]

Uw bedrijf voor Multimedia op Maat


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to