Hi,
I have the following query
SELECT
user_details.User_club_ID,
user_details.fname,
user_details.lname,
user_details.email,
user_details.club_No
club.CLUBCODE,
club.club_id
FROM user_details, club
WHERE club_id = $cid AND user_details.club_No = club.CLUBCODE AND user_status = 'active'";
which I converted to a prepared statement as
SELECT
user_details.User_club_ID,
user_details.fname,
user_details.lname,
user_details.email,
user_details.club_No
club.CLUBCODE,
club.club_id
FROM user_details, club
WHERE club_id = ? AND user_details.club_No = club.CLUBCODE AND user_status = ?";
Please note that user_status is a field in the table user_details. The original query (non -PDO) works correctly.
I want to know if this is correct and that the comparison in the WHERE clause i.e. user_details.club_No = club.CLUBCODE is security safe. If not then how should this be modified.
Also if there is a better way to write this statement, kindly show that as well.
Thanks
Thanks all !