Moja strona działa bez zarzutu i wdrożyłem ją w heroku, a problem polega na tym, że heroku używa pgsql i używam frameworku mysql i laravel.Błąd Pgsql: Być może będziesz musiał dodać wyraźne odlewy typu:
moje zapytanie jest
$patient = Patient::where('patient_address', 'ILIKE' ,'%' . $request->input)->where('patient_sex', 'ILIKE' ,'%' . $request->gender)->whereHas('users', function($q) use($vaccine_id){
$q->where('vaccine_id','ILIKE','%' . $vaccine_id);
})->get();
oto co mi chodzi gdy wdrożyć go do Heroku
SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~* unknown LINE 1: ...ient_id" = "patients"."PatientID" and "vaccine_id" ILIKE $3)
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. (SQL: select * from "patients" where "patient_address" ILIKE %San Francisco and "patient_sex" ILIKE % and exists (select * from "vaccines" inner join "immunizations" on "vaccines"."VaccineID" = "immunizations"."vaccine_id" where "immunizations"."patient_id" = "patients"."PatientID" and "vaccine_id" ILIKE %))
Próbowałem za pomocą obsady jak CAST (vaccine_id AS VARCHAR) i nie otrzymuję błędu, ale nie zwraca żadnego wyniku.
nie znam tej API dobrze, ale 'gdzie "patient_address" ILIKE% San Francisco' jest źle,' San Francisco' powinien być pojedynczy przytacza AFAIK. –
to zmienna $ request-> input = san fancisco jak umieścić na niej pojedynczy cytat? – Christian
Nie jestem pewien, tylko mogę ci powiedzieć, że jeśli wynik zapytania jest dosłownie, to jest źle. –