为什么我的代码将数据发送到数据库 [英] Why is my code sending data into the database

查看:66
本文介绍了为什么我的代码将数据发送到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php

include(connection.php);

?>

<!DOCTYPE html>





< title>主页(酒店管理)





<?php
include("connection.php");
?>
<!DOCTYPE html>


<title>Home (Hotel Management)













我的项目




My Project







  • Home
  • Contact Us
  • Book My Reservation
  • Our Hotel
  • Help
























房间否
房间类型
房价




<?php

if(isset($ _ POST ['submit']))

{

$ rno = $ _ POST ['rno'];

$ type = $ _ POST ['type'];

$ p = $ _ POST ['price'];

if(mysqli_query($ a,insert)进入房间(rno,类型,价格)VALUES('$ rno','$ type','$ p')))

{

echo数据插入;

}

其他

{

echo数据未插入;

}

}



?>








Room No
Room Type
Room Price


<?php
if(isset($_POST['submit']))
{
$rno=$_POST['rno'];
$type=$_POST['type'];
$p=$_POST['price'];
if(mysqli_query($a,"insert into room (rno,type,price) VALUES ('$rno','$type','$p')"))
{
echo "data insert";
}
else
{
echo "Data not Inserted";
}
}

?>




















这是连接



<?php

$ a = mysqli_connect('localhost','root','','hd');

?>



我尝试了什么:



到目前为止我所学到的一切






And this is the connection

<?php
$a=mysqli_connect('localhost','root','','hd');
?>

What I have tried:

everything i've learned so far

推荐答案

_POST ['submit']))

{
_POST['submit']))
{


rno =


_POST ['rno'];
_POST['rno'];


这篇关于为什么我的代码将数据发送到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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