0

Im trying to get the Var Dump to display but all i get is a white screen. Any suggestions?

<?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();
}
5
  • 3
    Common issue - set error_reporting to E_ALL, so you can find your problem Commented Sep 3, 2012 at 23:04
  • 3
    Do you define a MYSQL constant in your config.inc.php script? Is that config script readable? Either of the requires will kill the script if they fail, and with you undoubtedly having display_errors/error_reporting turned off, you'll never see why. NEVER have those two options turned off while debugging/developing. It's like trying to read a book with your eyes ripped out. Commented Sep 3, 2012 at 23:04
  • 1
    Why do you think your huge if condition is true? Commented Sep 3, 2012 at 23:04
  • May be your if condition is not being executed. Commented Sep 3, 2012 at 23:07
  • @PeterSzymkowski I tried that it did not work Commented Sep 4, 2012 at 6:44

1 Answer 1

1

Unless MYSQL is a defined constant in your script, this line of code will fail and the script execution will stop immediately:

require(MYSQL);

As explained in the 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.