简体   繁体   中英

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.

$ConnServ is included via another .PHP page and is working on multiple other requests to server. 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.

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.

If it's something simple I'm going to bed...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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