1

So I am trying to make a program where the user would enter their information and a min of 5 and a max of 10 restaurant options in JSON format where the separate restaurants would be their own entry in a table.

UserID Restaurant Chosen
1 resta, restb, etc

What I want is the format below but in a MySQL database

UserID Restaurant Chosen
1 RestA
1 Restb
1 Restc

I am using python to code the API and Postman for the user to input the information in a json format, which will update the information in a MySQL database. Is what I am asking even possible? I am still learning about programming.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
Robotboy
  • 63
  • 8
  • Yes of course it is. Postman sends json POST to python. Python reads it, loops it and for each element, makes request to db to save it. You should study the parts you don't know. POST, Json, MySQL, related to python. – Alexandru Trandafir Catalin Oct 16 '21 at 14:41
  • How would I write the loop method? – Robotboy Oct 16 '21 at 16:27
  • Check those two, I'm not a Python developer https://stackoverflow.com/a/24119878/115050 https://stackoverflow.com/a/42445385/115050 just think of each step you need and go to learn a python course/tutorial about that specific step – Alexandru Trandafir Catalin Oct 16 '21 at 16:53

0 Answers0