gpt4 book ai didi

php - 变量转储不显示

转载 作者:行者123 更新时间:2023-11-29 14:18:03 25 4
gpt4 key购买 nike

我试图显示 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();
}

最佳答案

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

require(MYSQL);

documentation 中所述:

require is identical to include except upon failure it will also produce a fatal E_COMPILE_ERROR level error. In other words, it will halt the script whereas include only emits a warning (E_WARNING) which allows the script to continue.

关于php - 变量转储不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12254893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com