0

希望还有其他人一直在使用 ignited 数据表交叉手指......我已经尝试了一段时间,但为什么它根本不让我使用 PHP 值是没有意义的 -->

include $DOCUMENT_ROOT.'/include/config.inc';
include $DOCUMENT_ROOT.'/include/session_check.inc';

require_once($DOCUMENT_ROOT.'/include/Datatables.php');
$datatables = new Datatables();

// MYSQL configuration
$config = array(
'username' => $dbuser,
'password' => $dbpass,
'database' => $dbname,
'hostname' => $dbhost);

$datatables->connect($config);

$datatables
->select('users.id as user_id, users.name as realname, users.username as username, users.email as email, users.phone as phone, domain.name as domain_name')
->from('users')
->join('domain', 'domain.id = users.domain_id', 'left')
->where('users.domain_id = "$domain_id"')
->add_column('available', '$1', 'available(available)')
->add_column('edit', '<a href="/wh.php?edit=1&id=$1" title="Purge the info for this Stock"><img src="/images/icons/dark/pencil.png" border="0"></a>', 'stock_id')
->unset_column('user_id');

echo $datatables->generate();

现在,价值 $domain_id 根本不可用。我想知道我放错了还是在这样的字符串组合中可以接受?

4

1 回答 1

0

好的..我的错误..而不是线

->where('users.domain_id = "$domain_id"')

我应该用这个

->where('users.domain_id', $domain_id)

现在一切正常..thanx 无论如何:-)

于 2012-08-06T19:48:19.037 回答