开发者

Why isn't this define variable sticking in PHP?

Can someone explain to me why in the world my DB_PREFIX variable is not accessible? When echoed, it just prints out DB_PREFIX to screen. All of my other defined variables are being printed to screen just fine, when called of course.

Help?

debug.php

require_once('db/config.php');

$conn = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME, $conn);

$query = 'SELECT * FROM `' . DB_PREFIX . 'test01`';

echo DB_PREFIX;
?>

db/config.php:

<?php
/* MySQL Settings */
/** MySQL Database Name */
define('DB_NAME', 'urdasandbox');

/** MySQL Username */
define('DB_USER', 'urdasandbox');

/** MySQL Password */
define('DB_PASS', 'wouldnt you like to know kid-o');

/** MySQL Hostname */
define('DB_HOST', 'yourmother.trebek.com');

/** Database Charset */
define('DB_CHARSET', 'utf8');

/** Database Table Type */
define('DB_TABLETYPE', 'Inno开发者_如何学运维DB');

/** Database Collate Type */
define('DB_COLLATE', '');

/**
 * DB Table prefix.
 */
define('DB_PREFIX', 'udb_');

/** absolute path to the directory. */
if(!defined('ABSPATH'))
    define('ABSPATH', dirname(__FILE__) . '/');
?>


Removing the directory, and re-uploading my file set corrected the issue. Either it was a cache or apache thing... But it is fixed now with zero code change.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜