我的PHP代码如下:
$data = $grid->GetData();
foreach($data as $key => $value) {
$sql =" SELECT users_details.user_state,users_details.user_city FROM ".TBL_USERS." AS user, "
$sql .= TBL_USERS_DETAILS." AS users_details WHERE user.user_id = ". $data['user_id'];
echo $sql; die;
$this->mDb->Query( $sql);
$data = $this->mDb->FetchArray();
}
数组 $data 如下:
Array
(
[0] => Array
(
[user_id] => 9def02e6337b888d6dbe5617a172c18d
[user_first_name] => Ashutosh
[user_last_name] => Modi
[user_email] => ashutosh.modi@gmail.com
[user_status] => enable
[user_subscription] => lifetime
[user_registered_type] => online
[user_reg_date] => 1325581397
)
[1] => Array
(
[user_id] => a6d22e4cc3f65778a60b359842bcec82
[user_first_name] => Dilip
[user_last_name] => Modi
[user_email] => dm.modi@gmail.com
[user_status] => enable
[user_subscription] => period
[user_registered_type] => online
[user_reg_date] => 1325152066
)
)
现在在查询部分,我想在 where 条件下使用上述数组中的 user_id 值,但我无法做到。我在某个地方出错了吗?你能帮我改正吗?当我打印查询时,会出现空白屏幕而不是正确的查询。提前致谢。