Greetings all...
i'm trying to write a query in PHP for my MySQL database...
what i'm trying to do is pull customer_name from the customers table, and user_name from the users table, and they are linked by customer_id...
and then comparing to variables i'm loading in. I can get it to work if i use just the users table and do customer_id, but i really want to do customer_name (which is only in the customers table)...
i used to be good at SQL, but can't figure out how to do it through PHP...
this is the code i've got:
PHP Code:
$query = "SELECT * FROM users, customers WHERE users.customer_id = customers.customer_id AND customer_name = '$custID' AND user_login = '$username'";
what am i doing wrong?
tia!