mercredi 10 février 2021

How to modify SQL string in PHP?

My code is this:

elseif ($criteria == 'doctoratedegree')
    $query->where('postgradcourses', 'LIKE', '%' . $searchItem . '%');

So basically in the front end, a person will select "Doctorate degree" in the form drop down menu, then type the course they want to search for and the code will look for the course in the postgradcourses column of the courses database table. problem is, the Masters degree option in the menu is coded in the same way where the code will also look in the postgradcourses column.

How can I modify the query code so that it searches for: PhD in . $searchItem . ?

Basically, the code will add a specific string along with whatever the person searched for.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3rBPfFa
via IFTTT

Aucun commentaire:

Enregistrer un commentaire