这个问题在这里已经有了答案:
我的pdo声明不起作用(1个答案)
四年前关门了。
mysql似乎没有插入到我的表中,即使没有显示错误,我甚至使用了
error_reporting(E_ALL);
ini_set('display_errors', '1');
但它总是不返回任何东西,这是我的代码:
连接文件
<?php
class Connexion
{
public static function cnx()
{
try{
$db=new PDO('mysql:host=localhost;dbname=championship','root','');
return $db;
}
catch(Exception $e){
die('Erreur :'.$e->getMessage());
}
}
}
?>
主文件
<?php
session_start();
include_once("../cnx.php");
include_once('theme.php');
include_once('criteria.php');
$num_rows=Criteria::countCriteria();
$id_theme=$_GET['id_theme'];
for ($i = 1; ; $i++) {
if ($i > $num_rows) {
break;
}
Criteria::saveScoreByCriteria($_SESSION['user']['id'],$i,$_POST["mark_criteria$i"],$_POST["comment_criteria$i"],$id_theme);
}
Theme::saveJudgeScore($id_theme,$_SESSION['user']['id'],$_POST["judge_general_comment"]);
header("location:list_theme.php");
?>
这就是函数 saveScoreByCriteria($id_judge,$id_criteria,$mark,$comment,$id_theme)
```
希望有人能帮我!谢谢。
这是完整的错误日志文件
[Thu Oct 06 08:31:40.250444 2016] [mpm_winnt:notice] [pid 7872:tid 292] AH00428: Parent: child process 5128 exited with status 1073807364 -- Restarting.
[Thu Oct 06 08:35:32.354324 2016] [ssl:warn] [pid 5572:tid 296] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 08:35:32.619524 2016] [core:warn] [pid 5572:tid 296] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Oct 06 08:35:33.274725 2016] [ssl:warn] [pid 5572:tid 296] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 08:35:36.925132 2016] [mpm_winnt:notice] [pid 5572:tid 296] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations
[Thu Oct 06 08:35:36.925132 2016] [mpm_winnt:notice] [pid 5572:tid 296] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
[Thu Oct 06 08:35:36.925132 2016] [core:notice] [pid 5572:tid 296] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
[Thu Oct 06 08:35:36.956332 2016] [mpm_winnt:notice] [pid 5572:tid 296] AH00418: Parent: Created child process 4244
[Thu Oct 06 08:35:38.251134 2016] [ssl:warn] [pid 4244:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 08:35:39.093535 2016] [ssl:warn] [pid 4244:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 08:35:39.171535 2016] [mpm_winnt:notice] [pid 4244:tid 308] AH00354: Child: Starting 150 worker threads.
[Thu Oct 06 14:06:00.652885 2016] [mpm_winnt:notice] [pid 5572:tid 296] AH00428: Parent: child process 4244 exited with status 1073807364 -- Restarting.
[Thu Oct 06 14:21:10.787495 2016] [ssl:warn] [pid 1200:tid 296] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 14:21:10.959095 2016] [core:warn] [pid 1200:tid 296] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Oct 06 14:21:11.473896 2016] [ssl:warn] [pid 1200:tid 296] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 14:21:14.709503 2016] [mpm_winnt:notice] [pid 1200:tid 296] AH00455: Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 configured -- resuming normal operations
[Thu Oct 06 14:21:14.709503 2016] [mpm_winnt:notice] [pid 1200:tid 296] AH00456: Apache Lounge VC11 Server built: Nov 21 2013 20:13:01
[Thu Oct 06 14:21:14.709503 2016] [core:notice] [pid 1200:tid 296] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache'
[Thu Oct 06 14:21:14.740703 2016] [mpm_winnt:notice] [pid 1200:tid 296] AH00418: Parent: Created child process 648
[Thu Oct 06 14:21:16.581506 2016] [ssl:warn] [pid 648:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 14:21:17.252307 2016] [ssl:warn] [pid 648:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Thu Oct 06 14:21:17.314707 2016] [mpm_winnt:notice] [pid 648:tid 308] AH00354: Child: Starting 150 worker threads.
1条答案
按热度按时间klr1opcd1#
这条线可能会导致您的问题,使用
static
非静态方法改用这个