簡體   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