Co do VALUE vs VALUES rozumiem że tutaj:
$query = "replace into rightone_crm.leads (id, firstname, lastname, dob, company, occupation, income, spousename, spouselastname, spousedob, spousecompany, spouseoccupation, spouseincome, street, area, city, state, child1name, child1dob, child2name, child2dob, child3name, child3dob, child4name, child4dob) values ";
zmiana nic nie daje. Taka sama odpowiedź, czyli wyświetla teraz wszystkie rekordy odczytane z CRM a błąd ten sam.
Zapytanie wyglada tak: ('1224189000000180007','Ewa Anna','Gwizdon','1961-10-17','St. Gabriels Nursing Home','Chef','','Maciej Jan','Pawlowski','1970-01-14','Onsite Refeuling','HGV Driver','32400','11 Ballyhoy Avenue','','Raheny, Dublin 5','Dublin','Kacper Pawlowski','1995-02-04','Krystian Pawlowski','2000-07-30','','','',''), ('1224189000000174021','Izabella','Imołczyk','','','','0','','','','','','0','16 Devlin Street','Fermoy','Fermoy','Co.Cork','','','','','','','',''), ('1224189000000174011','Dorota','Malec','1983-03-17','','','','','','1983-01-11','','','','','','Letterkenny','Co. Donegal','Tomek?','2007-02-03','','','','','',''), ('1224189000000174007','Adam','Wickowski','1978-12-24','','','','','','','','','','','','Galway','Co. Galway','','','','','','','',''), ('1224189000000165001','Mariusz','Mariusz','1979-05-07','','Cleaner In Meat Factory','','Partnerka','','','','','','','','','Co. Leitrim','','','','','','','',''), ('1224189000000162093','Krystian','Aleksander','1979-10-18','Burke Shipping Group','HMV Driver','36400','','','','','','','30 Kilmore Avenue','Coolock','Dublin 17','Co.Dublin 17','','','','','','','',''), ('1224189000000158027','Ernest','Luft','','','Welder','','','','','','','','56 Riverwalk','','Dublin','','','','','','','','',''), ('1224189000000157070','AA','Testowy','','','','0','','','','','','0','','','','','','','','','','','',''), ('1224189000000148001','Justyna','Dybas','','','','','','','','','','','','','Dublin','Co.Dublin','','','','','','','',''), ('1224189000000144281','Krzysztof','Reczek','','TKCCC','Garage Owner','0','Agnieszka','','','','','0','51 Burnell Green','Northern Cross','Dublin 17','Dublin','','','','','','','','') A tak wyglada blad:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1224189000000180007','Ewa Anna','Gwizdon','1961-10-17','St. Gabriels Nursing Ho' at line 1
Dodam to co już pisałem. Jak usunę warunek if else tutaj:
/* Inserting in database */
$query = "replace into rightone_crm.leads (id, firstname, lastname, dob, company, occupation, income, spousename, spouselastname, spousedob, spousecompany, spouseoccupation, spouseincome, street, area, city, state, child1name, child1dob, child2name, child2dob, child3name, child3dob, child4name, child4dob) value ";
to kod działa prawidłowo i wstawia wszystkie dane (dla token1 i token2) do bazy rightone_crm.leads. Problem, że tak nie ma być :-(