How to use php to build background server data?

topic description

to learn from the front end, I wrote an interface for ordering menus, but I wanted to store the menu data in the server. There are also customers" orders after ordering are also stored in one place (due to the lack of knowledge, I do not know how to describe this" place", which is used to count what is sold and how much money is made in a month. )

sources of topics and their own ideas

1. Menu data: I want to make it in json format, and then there is an interface that I can call at the front end.
2. After the customer orders (checkout): they also want to store it, mainly because they want to return the data to the background (extract it to the background)

because I don"t know anything about the back end, and I don"t want to ask for help (mainly no friends.) so I want to write what I want through php. The data for the
menu looks something like this:

[
    {
        "goodsId": 1,
        "goodsName": "",
        "price": 18
    },
    {
        "goodsId": 2,
        "goodsName": "",
        "price": 15
    },
    {
        "goodsId": 3,
        "goodsName": "",
        "price": 15
    },
    {
        "goodsId": 4,
        "goodsName": "",
        "price": 18
    },
    {
        "goodsId": 5,
        "goodsName": "",
        "price": 20
    },
    {
        "goodsId": 6,
        "goodsName": "",
        "price": 20
    },
    {
        "goodsId": 7,
        "goodsName": "",
        "price": 10
    },
    {
        "goodsId": 8,
        "goodsName": "",
        "price": 18
    },
    {
        "goodsId": 9,
        "goodsName": "",
        "price": 25
    },
    {
        "goodsId": 10,
        "goodsName": "",
        "price": 99
    }
]

then I call the front end, want to ask these two questions, need to learn what knowledge can be quickly started .
Thank you again for your answers!

Php
Mar.29,2021

the most direct thing is to connect the data inventory with node.js. If you want to use php, it will be better to learn the basic knowledge, and then learn mysql. Do not rush into php database connection directly. It is easier to be confused than


.

the simplest thing about php: is to create a data table with a field of: goodsId, goodsName, price

.

then phpPdo connects to the database;
queries all the data and returns it as json; using the php json_encode function

it's easier to use a framework;

the knowledge points to be learned are database and php

if you use nodeJs, nodeJs can learn relatively quickly, because its syntax is the same as js, so it is faster to get started!

Menu