0

我试图让 Var Dump 显示,但我得到的只是一个白屏。有什么建议么?

<?php
require('includes/config.inc.php');
require(MYSQL);
$aid = FALSE;
if (isset($_GET['aid']) && filter_var($_GET['aid'], FILTER_VALIDATE_INT, array('min_range' => 0))){
  $aid = $_GET['aid'];

  $q = "SELECT aircraft_id, aircraft_name AS name, aircraft_type AS type, tail_number AS tn FROM aircraft WHERE aircraft_id=$aid";
var_dump($q); die();
}
4

1 回答 1

1

除非MYSQL是脚本中定义的常量,否则这行代码将失败并且脚本执行将立即停止:

require(MYSQL);

文档中所述:

require 与 include 相同,但失败时也会产生致命的 E_COMPILE_ERROR 级别错误。换句话说,它将停止脚本,而 include 只发出一个警告(E_WARNING),允许脚本继续。

于 2012-09-03T23:10:10.183 回答