Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
433 views
in Technique[技术] by (71.8m points)

javascript - 如何将数据插入php数组并将其存储到数据库中?(how to insert data into a php array and store it into a database?)

I would like to do a restaurant system where the user can click on many choices that have in the food menu, the food name and price will be saved in the separate array in different tables in the databas.

(我想做一个餐厅系统,用户可以单击食物菜单中的许多选项,食物名称和价格将保存在数据库中不同表中的单独数组中。)

At first, I would like to do a javascript function when the checkbox is clicked then I realized that I do that in the foreach loop, so when looping the same value will be assigned over and over again and the same value will also be inserted in the array.

(首先,我想在单击复选框时执行javascript函数,然后我意识到我在foreach循环中执行此操作,因此在循环时,将一次又一次分配相同的值,并且还将在其中插入相同的值数组。)

What I would like to do is when the user clicks on many items, the menu name and price will be saved in their array and

(我想做的是,当用户单击许多项目时,菜单名称和价格将保存在其数组中,)

I will be using the array to do the receipts.

(我将使用数组做收据。)

This is the code that I have done so far.

(这是我到目前为止所做的代码。)

第一编码图像 first coding image.

(第一编码图像。)

第二编码图像 second coding image.

(第二编码图像。)

  ask by Eric Stephan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...