简体   繁体   English

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

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

I'm having a problem with a snippet of my code not entering data into the database. 我的代码片段未将数据输入数据库时​​出现问题。 Does anyone see it? 有人看到吗? Cuz, I don't see it... 因为我看不到...

I'm using 000's free web hosting for testing purposes if that matters. 如果重要的话,我正在使用000的免费虚拟主机进行测试。

$ConnServ is included via another .PHP page and is working on multiple other requests to server. $ConnServ包含在另一个.PHP页面中,并且正在处理对服务器的其他多个请求。 All spelling has been checked multiple times. 所有拼写已被检查多次。 This script worked at one point but it was a separate page. 该脚本曾经工作过,但它是一个单独的页面。 It was then consolidated onto the same page as the HTML form for 'required field' checking. 然后将其合并到与HTML表单相同的页面上,以进行“必填字段”检查。

Code is throwing zero errors. 代码抛出零错误。

<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.

No data is being input into the database fields, the auto increment is not being incremented either, yet all the data seems to make it to the $sql request. 没有数据输入到数据库字段中,自动增量也未增加,但是所有数据似乎都已到达$sql请求。

If it's something simple I'm going to bed... 如果这很简单,我就去睡觉...

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

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

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