How to retrieve using multiple conditions
Permalink
I found [$list->filterByStudentFirstName('Andrew');] from the following link.
https://documentation.concrete5.org/developers/express/creating-read...
How to retrieve data with multiple conditions?
https://documentation.concrete5.org/developers/express/creating-read...
How to retrieve data with multiple conditions?
Is it the following that you mean?
$list->filterByStudentID(1);
$list->filterByStudentFirstName('Andrew');
$list->filterByStudentExamResult(100);
I would like to replace instead of sql query [select * from student where studentid='1' and studentfirstname='Andrew' and studentexamresult=100] with concrete5 retrieve format.
$list->filterByStudentID(1);
$list->filterByStudentFirstName('Andrew');
$list->filterByStudentExamResult(100);
I would like to replace instead of sql query [select * from student where studentid='1' and studentfirstname='Andrew' and studentexamresult=100] with concrete5 retrieve format.
Yes except once you filtered by ID you probably don't need the other stuff as most likely each ID is unique and only one student has it.
In the example I gave you would get all students with first name Andrew OR Robert
In the example I gave you would get all students with first name Andrew OR Robert
Thank for the reply.
how to loop and retrieve $results?
how to loop and retrieve $results?
foreach ($results as $result) { // do something with current $result }
Another possibility, but I didn't test it would be
It might work but like I said, I didn't test it.