Php 不显示来自sql视图单列的数据
我在Php 不显示来自sql视图单列的数据,php,sql,phpmyadmin,jquery-jtable,Php,Sql,Phpmyadmin,Jquery Jtable,我在phpmyadmin中有一个SQL视图,其中有一个用于填充使用jquery jtable创建的表中的数据。这个问题非常奇怪,因为只有一个列的数据没有显示,而其他所有列的数据都没有显示问题。当我编辑字段时也没有问题,我可以看到我在phpmyadmin中所做的更改。如何显示“成功”列?非常感谢您的帮助 表格截图 function getLessonsLearnedResponseChildTable(ContainerID) { var table = { title: '',
phpmyadmin
中有一个SQL视图
,其中有一个用于填充使用jquery jtable
创建的表中的数据。这个问题非常奇怪,因为只有一个列的数据没有显示,而其他所有列的数据都没有显示问题。当我编辑字段时也没有问题,我可以看到我在phpmyadmin中所做的更改。如何显示“成功”列?非常感谢您的帮助
表格截图
function getLessonsLearnedResponseChildTable(ContainerID) {
var table = {
title: '',
width: '5%',
sorting: false,
edit: false,
create: false,
display: function(data) {
//create an image to be used to open child table
var $img = $('<img src="' + config.base_url + 'assets/images/expand_row-small.png" title="View Responses" style="height:30px;width:30px;cursor:pointer;" height="30" width="30"/>');
$img.click(function() {
$('#' + ContainerID).jtable('openChildTable',
$img.closest('tr'),
{
title: data.record.event,// + ' - Response Plans'
actions: {
listAction: config.base_url + "data_fetch/responses/" + data.record.risk_id,
deleteAction: config.base_url + 'data_fetch/delete_response/',
updateAction: config.base_url + 'data_fetch/edit_response/'
},
messages: defaultResponseMessages,
fields: LessonsLearnedResponseFields
}, function(data) {//opened handler
data.childTable.jtable('load');
});
});
//return image to show on row
return $img;
}
};
return table;
}
js
处理表的创建
function getLessonsLearnedResponseChildTable(ContainerID) {
var table = {
title: '',
width: '5%',
sorting: false,
edit: false,
create: false,
display: function(data) {
//create an image to be used to open child table
var $img = $('<img src="' + config.base_url + 'assets/images/expand_row-small.png" title="View Responses" style="height:30px;width:30px;cursor:pointer;" height="30" width="30"/>');
$img.click(function() {
$('#' + ContainerID).jtable('openChildTable',
$img.closest('tr'),
{
title: data.record.event,// + ' - Response Plans'
actions: {
listAction: config.base_url + "data_fetch/responses/" + data.record.risk_id,
deleteAction: config.base_url + 'data_fetch/delete_response/',
updateAction: config.base_url + 'data_fetch/edit_response/'
},
messages: defaultResponseMessages,
fields: LessonsLearnedResponseFields
}, function(data) {//opened handler
data.childTable.jtable('load');
});
});
//return image to show on row
return $img;
}
};
return table;
}
get_all
响应模型中的方法
/*
* Retrieves all responses associated with the risk
*/
public function get_all($risk_id, $user_id, $limit = null, $offset = 0, $order_by = null, $direction = 'ASC') {
//load risk model to check if user can read from project
$this->load->model('Risk_model');
if ($this->Risk_model->initialize($risk_id, $user_id) == false) {
return false;
}
if ($limit !== null && $limit != 0) {
$this->db->limit($limit, $offset);
}
if ($order_by !== null) {
$this->db->order_by($order_by, $direction);
}
$query = $this->db->select('SQL_CALC_FOUND_ROWS *', false)->from('view_responses')->where('risk_id', $risk_id)->get();
$data = $query->result_array();
$this->load->model('Task_model');
foreach ($data as &$response)
$response['WBS'] = $this->Task_model->normalize_WBS($response['WBS']);
$data['num_rows'] = $this->db->
query('SELECT FOUND_ROWS()', false)->row(0)->{'FOUND_ROWS()'};
return $data;
}
sql视图的屏幕截图
成功
已接收但未显示
我已经解决了这个问题。这是一个拼写问题。我从SQL视图中成功获得了一个缺少的c,现在它工作正常。请发布视图的定义和一些示例数据,这些数据将呈现您没有得到的输出。无代码,无帮助。对这个问题的描述是无用的。