Hello everyone,
This seems like a simple task that has been driving me nuts. The CRUD API section has the following question: First, try to update any city’s name to be ‘flag’. Then, delete any city. Once done, search for a city named ‘flag’ to get the flag.
I am having issues with the PUT request (update):
- Update
curl -X PUT “http://161.35.33.243:30573/api.php/city/London” -d ‘{“city_name”:“flag”}’ -H “Content-Type: application/json”
I am getting the following error:
Unknown column ’ ’ in ‘field list’.
I literally copied the example in the lesson and replaced the IP:PORT.
I had no issues deleting a record and reading records. I have tried modifying ‘city_name’ in case the SQL db uses something else, but I kept getting the same error. Interesting enough, if I replace my json data with empty brackets, I get another error:
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 ‘where city_name=‘Houston’’
Even the error shows that I am using the correct column name. I’m completely lost.