This topic is locked

using SQL variables

4/16/2023 6:15:01 AM
PHPRunner General questions
F
francesco author

I want the user to be able to query the SQL Server using a predefined query but being able to change the 'input'. Here is the query:
SELECT operators.name, timesheet.date FROM operators LEFT OUTER JOIN timesheet ON operators.id_op = timesheet.operator WHERE timesheet.date= :my_date OR timesheet.dateIS NULL;my_date is the search parameter.
What is the best way to pass this parameter to the query?

fhumanes 4/16/2023
francesco 4/16/2023

Thanks Fernando but it didn't help me.
I post the question in other way, please forget first request: with this query
SELECT operators.name, timesheet.date FROM operators LEFT OUTER JOIN timesheet ON operators.id_op = timesheet.operator``I want to show also NULL values on date field when I make a date search.
So I want to display always all operators.name list.
Can you help me?