在php中得到两个数字的总和后,如何将答案保存到数据库中。 [英] how to save an answer into database after we get the sum of two numbers in php.

查看:82
本文介绍了在php中得到两个数字的总和后,如何将答案保存到数据库中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在php中获取两个数字的总和后如何将答案保存到数据库中。

解决方案

你必须学习有关PHP和MySQLi的CRUD [ ^ ]为了做到这一点。

基本内容:

1. SQL [ ^ ]

2. PHP 5 MySQLi [ ^ ]


//首先获取两个数字。



添加两个数字





输入数字1:



// fo r no.1 textbox











输入数字2:



// for no.2文本框















//检查按钮是否设置

if(isset(


_POST ['add']))

{

//在变量中存储值

how to save a answer into database after we get the sum of two numbers in php.

解决方案

You have to learn CRUD with PHP and MySQLi[^] in order to do it.
Some basic stuffs:
1. SQL[^]
2. PHP 5 MySQLi[^]


//first fetch that two numbers.


Addition of two numbers



Enter Number 1:

// for no.1 textbox





Enter Number 2:

// for no.2 textbox







// check button is set or not
if(isset(


_POST['add']))
{
// store value in variable


这篇关于在php中得到两个数字的总和后,如何将答案保存到数据库中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆