繁体   English   中英

为什么未将此数据集输入数据库?

[英]Why is this data set not being entered into the database?

我的代码片段未将数据输入数据库时​​出现问题。 有人看到吗? 因为我看不到...

如果重要的话,我正在使用000的免费虚拟主机进行测试。

$ConnServ包含在另一个.PHP页面中,并且正在处理对服务器的其他多个请求。 所有拼写已被检查多次。 该脚本曾经工作过,但它是一个单独的页面。 然后将其合并到与HTML表单相同的页面上,以进行“必填字段”检查。

代码抛出零错误。

<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<!-- this was included to show how the form interacts with the below code. -->
//Add Table Data
$sql = $ConnServ->prepare("INSERT INTO TestingDatabase (file,fileTwo,text,textTwo,tPos,tPosTwo,owner,createDate,invisible,tags)
VALUES (?,?,?,?,?,?,?,?,?,?)");
$sql->bind_param("ssssiissis",$fileName,$fileName2,$textinput,$textinput2,$textPos,$textPos2,$ContentOwner,$currentDate,$visState,$lineTags);
$sql->execute();
$sql->close();

//echo '<a>'. $fileName . $fileName2 . $textinput . $textinput2 . $textPos . $textPos2 . $ContentOwner . $currentDate . $visState . $lineTags .'</a>'; //<- this will echo the correct data from the form inputs if not commented out.

没有数据输入到数据库字段中,自动增量也未增加,但是所有数据似乎都已到达$sql请求。

如果这很简单,我就去睡觉...

您需要使用commit()提交事务

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM