Hello,

I'm trying to get mysql_num_rows from 4 tables where user id is being selected as session .
My question is very simple :
Is this sql is correct :
""SELECT * FROM users_tbl,events_tbl,players_tbl,sales_tbl,teachers_tbl WHERE events_tbl.user_id & players_tbl.user_id & sales_tbl.user_id & teachers_tbl.user_id = '$whois_id'";

?

user_id - The user id
$whois_id - check who is currently logged in (session) .

Please help ...

No. You have to use comparison operators on table pairs.

SELECT * FROM users_tbl,events_tbl,players_tbl,sales_tbl,teachers_tbl 
WHERE users_tbl.user_id=events_tbl.user_id
and events_tbl.user_id=players_tbl.user_id
and players.tbl_user_id=sales_tbl.user_id
and sales_tbl.user_id=teachers_tbl.user_id
and users_tbl.user = '$whois_id'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.