0

Im using PHPGenerator for mysql to generate some pages at work.

Is it possible for me to do a MySQL query like below?
Or am i trying something thats impossible??

SELECT 
  training.id,
  training.Employee_Name,
  training.Team_Name,
  training.Date_Requested,
  training.Course_Information,
  training.Training_Provided,
  training.Time_Taken,
  training.Trainer,
  training.Critique_Completed,
  training.Certification,
  training.Comments,
  training.file_name,
  training.file_type,
  training.file_size,
  training.Training_Information_Given_Was,
  training.Training_Course_Structure_Was,
  training.Training_Instructor_Was,
  training.Training_Instruction_Aids_Was,
  training.Training_Aids_Used,
  training.Online_Material_Used
FROM
  training
WHERE
  training.Training_Provided = 'No' AND
%current_user_id% = Userlist.Staff_name WHERE userlist.Role NOT LIKE 'Employee'
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by smantscheff
0

If you query more than one table you have to
- list all tables in the FROM clause: add ", userlist" to the FROM clause;
- use a where clause which semantically links the rows of one table to the other. This is missing in your where clause.
It is also syntactically wrong - replace the second "WHERE" by "AND".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.