Reputation: 199
I have a basic MYSQL query, that I am playing with and testing some API data, the problem is that for some reason, whilst the database is being populated perfectly by the test information, If i add any new fields the database simply doesn't insert any data in to them. I have tried several different fields and tried to add even simple data.
My latest attempt is trying to insert a value in to the hostname field, but again whilst it inserts data in to all of the other fields it skips this one?
INSERT INTO vistordetails1
(ipaddress, hostname, client_id, type, date_time, company_name, location, search_term, trafic_source, no_of_pages, country_code) VALUES('$ip_address', '1', '$client_id', '$type', now(),'$fields[11]','$fields[6]', '$keyword', '$referer','1','$country_code')
Ok so I changed the code to this, to replace the values
INSERT INTO vistordetails1
(ipaddress, client_id, type, date_time, company_name, location, search_term, trafic_source, no_of_pages, country_code) VALUES('1', '1', '1', now(),'1','1', '1', '1','1','1')
Ok so now I have corrected the code as above when i copy and paste this in to PHP MY ADMIN i get no issues, it inserts all of the values except for the field hostname, which was that last table field i added.
Upvotes: 0
Views: 113
Reputation: 67
You missed the semicolon at the end.Please check.This might causes error. and add quote at the last '1'.You missed that.
Upvotes: 1
Reputation: 4111
missing quote at the end 1
INSERT INTO vistordetails1
(ipaddress, client_id, type, date_time, company_name, location, search_term, trafic_source, no_of_pages, country_code) VALUES('1', '1', '1', now(),'1','1', '1', '1','1','1')
Upvotes: 2