0
I’m in a lot of trouble with my xampp
, have some time I’ve been trying to add anything into the database mysql
but I am not successful in my attempts.
In the error.log
PHP is described the following lines:
[Sat Feb 13 01:31:07.052501 2016] [mpm_winnt:notice] [pid 2604:tid 468] AH00455: Apache/2.4.18 (Win32) Openssl/1.0.2e PHP/7.0.1 configured -- resuming normal Operations
[Sat Feb 13 01:31:07.052501 2016] [mpm_winnt:notice] [pid 2604:tid 468] AH00456: Apache Lounge VC14 Server built: Dec 9 2015 10:17:39
[Sat Feb 13 01:31:07.052501 2016] [core:notice] [pid 2604:tid 468] AH00094: Command line: 'c: xampp apache bin httpd.exe -d C:/xampp/apache'
[Sat Feb 13 01:31:07.064486 2016] [mpm_winnt:notice] [pid 2604:tid 468] AH00418: Parent: Created Child process 6052
[Sat Feb 13 01:31:09.051887 2016] [ssl:warn] [pid 6052:tid 116] AH01909: www.example.com:443:0 server Certificate does NOT include an ID which Matches the server name
[Sat Feb 13 01:31:09.457471 2016] [ssl:warn] [pid 6052:tid 116] AH01909: www.example.com:443:0 server Certificate does NOT include an ID which Matches the server name
[Sat Feb 13 01:31:09.562545 2016] [mpm_winnt:notice] [pid 6052:tid 116] AH00354: Child: Starting 150 worker threads.
I’m making a insert
simple as following:
try {
$campos = array();
$campos[':TXT_NOMEX_BANNE'] = $targetFile;
$campos[':pesso'] = '1'; //$suc->$COD_IDENT_USUAR();
$sql = "INSERT INTO tbl_banner (`TXT_NOMEX_BANNE`, `COD_ULTIM_ATUAL`, `DAT_ULTIM_ATUAL`) VALUES (:TXT_NOMEX_BANNE, :pesso, now())";
$conexao = new ConexaoDatabase();
$conexao->save($sql, $campos);
move_uploaded_file($tempFile, $targetFile);
} catch (Exception $e) {
die('ERRO AO ATUALIZAR BANCO DE DADOS');
error_log($e->getMessage());
}
My folder structure is as follows:
|includes
|--conexao.php
|--suc_validacao.php
|paginas
|--upload.php
And I’m giving a include the following way:
include '../includes/suc_validacao.php';
include '../includes/conexao.php';
In the conexao.php
have a function save
, and it calls another function. Both described below:
public function save($sql, array $data) {
$con = self::getConnection();
$stmt = $con->prepare($sql);
$this->execute($stmt, $data);
if ($stmt->rowCount()) {
return true;
} else {
return false;
}
}
public function execute(PDOStatement $stmt, array $data = null) {
try {
if (isset($data)) {
$stmt->execute($data);
} else {
$stmt->execute();
}
return true;
} catch (PDOException $exc) {
if (isset($_SESSION['suc'])) {
return false;
}
}
If you have anything else to add, but I tried to do many things, among them reinstall the xampp
, redo the insert
, among others. None worked, I’ve looked on the internet for something about the error, but I also found nothing about.
I would love to help you solve this problem.
this error.log did not appear anything that has to do with mysql... is code error of your application itself...
– Danilo Breda
You have a Try catch in the execute method by silencing the PDO Exception. Try removing it and see which error message PHP returns.
– jefersondaniel
@jefersondaniel gave this error [Sat Feb 13 01:32:23.744686 2016] [negotiation:error] [pid 6052:tid 1816] [client :1:56891] AH00690: no acceptable Variant: C:/xampp/apache/error/HTTP_NOT_FOUND.html.var, referer: http://local:8080/take_web/admin/pages/banner.php [Sat Feb 13 09:38:59.366448 2016] [negotiation:error] [pid 6052:tid 1816] [client ::1:58029] AH00690: no acceptable Variant:
– Renan Rodrigues