简体   繁体   English

我的Web应用在服务器上看起来与众不同,并且可以在localhost上完美运行

[英]my web app looks different on server and works perfectly on localhost

i'm using datatables with codeigniter and it looked like this on localhost datatables on localhost 我正在使用带有codeigniter的数据表,并且在本地主机上的本地数据表上看起来像这样

and looked like this on server, i can't get the columns on the right side even if i enabled scrollX datatables on server 并在服务器上看起来像这样,即使我在服务器上启用了scrollX datatables ,我也无法获得右侧的列

my java-script code 我的Java脚本代码

 $(document).ready(function () { var oTable = $('#tb').dataTable({ "bProcessing": true, "bServerSide": true, "bStateSave": true, "autoWidth": false, "colReorder": true, "responsive": true, "scrollX": true, "sAjaxSource": '<?php echo base_url(roleURIUser()); ?>/leads/viewdata', "bJQueryUI": false, "sDom": 'T<"clear">Rlfrtip', "tableTools": { "sSwfPath": "<?= locationPlugin('url'); ?>datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" }, "sPaginationType": "full_numbers", "iDisplayStart ": 10, "aoColumns": [{ "mData": "name" }, { "mData": "mobile" }, { "mData": "phone" }, { "mData": "branch" }, { "mData": "code" }, { "mData": "email" }, { "mData": "university" }, { "mData": "faculty" }, { "mData": "address" }, { "mData": "date_created" }, { "mData": "status" }, { "mData": "comment" }, { "mData": "date_followup" }], "aoColumnDefs": [ {"bSearchable": false, "aTargets": [5, 6, 7, 8, 9, 10, 11, 12]}, {"bSortable": false, "aTargets": [5, 6, 7, 8, 9, 11, 12]}, {"width": "30%", "aTargets": [11]} ], "order": [[0, "desc"]], "oLanguage": { "sProcessing": "<img src='<?= locationUpload('url'); ?>/ajax-loader.gif'>" }, "fnInitComplete": function () { //oTable.fnAdjustColumnSizing(); }, 'fnServerData': function (sSource, aoData, fnCallback) { $.ajax ({ 'dataType': 'json', 'type': 'GET', 'url': sSource, 'data': aoData, 'success': fnCallback }); } }); 

检查名称旁边的按钮的图像路径。(+)和(-)图像路径。

I can not understand well at all. 我根本听不懂。

If the problem is that you can not get the data on the server, check your config data in application/config/database.php 如果问题是无法在服务器上获取数据,请在application / config / database.php中检查配置数据

$db['default']['hostname'] = "host";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = "mysqli";

If your CONECCION is correct, then the problem is in your model or your controller, eg 如果您的CONECCION是正确的,则问题出在您的型号或控制器上,例如

controller.php controller.php

function do_somthing(){
    $this->load->library('database');
    $this->load->model('model_file');

    $info = $this->model_file->get_data();

    var_dump($info);
}

model_file.php model_file.php

function get_data(){
    return $this->db->get('table')->result();
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP App在localhost上完美运行,在任何Web服务器上完全失败,并出现一些奇怪的错误 - PHP App works perfectly on localhost and fails completely on any web server with some strange errors 站点在localhost上完美运行,但在服务器上运行不正常 - Site works perfectly on localhost, but not on server URL完全适用于localhost,不适用于Web服务器 - URL perfectly working on localhost, not working on web server 我的 Codeigniter 网站可以在本地主机上运行,但不能在 web 服务器上运行? 500 内部服务器 - My Codeigniter site works on localhost but not on web server? 500 internal server 敏捷工具包CRUD在本地主机上完美运行,在服务器上引发错误 - Agile Toolkit CRUD works perfectly on localhost throws error on server PHP - file_get_contents() 在 localhost 但在实时服务器上完美运行 - PHP - file_get_contents() works perfectly on localhost but on live server URL 模块在 localhost 上完美运行,但在 Web 服务器上不起作用 - URL module perfectly working on localhost, but not working on web server 将 php(codeigniter)中的 web 应用程序从本地主机传输到我的服务器和域 - Transfer web app in php (codeigniter) from localhost to my server and domain 方法发布在localhost上有效,但在Web服务器上无效 - Method post works on localhost but not in web server PHP问题(在localhost上有效,但在Web服务器上错误) - Problem with PHP (works on localhost, but errors on web server)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM