小编Ana*_*har的帖子

消息:未定义的属性:CI_Loader :: $ table

这是我的控制器..

class Customer extends CI_controller
{

public function __construct()
{
    parent::__construct();
    $this->load->model('Customer_model');
}
public function create()
{

        $this->load->helper('form');
        $this->load->library('form_validation');
    $this->form_validation->set_rules('name', 'Name', 'required');
    $this->form_validation->set_rules('address', 'Address', 'required');
    $this->form_validation->set_rules('office_phone', 'Phonenumber', 'required');
    $this->form_validation->set_rules('fax', 'Faxno.', 'required');
    $this->form_validation->set_rules('email', 'Mailaddress', 'required');

    $data = array(
        'name' => $this->input->post('name'),

        'address' => $this->input->post('address'),

        'phoneno' => $this->input->post('office_phone'),

        'fax' => $this->input->post('fax'),

        'email' => $this->input->post('email')
    );


    if ($this->form_validation->run() === FALSE)
    {
        $this->load->helper('url');
        $this->load->view('templates/header');  
        $this->load->view('master/customer',$data);
    }
    else
    {

        $this->Customer_model->register($data);
        $this->load->library('session');
       //$this->session->set_flashdata('message', 'New Contact has been added');
             //redirect(current_url());
        $this->load->helper('url');
        $this->load->view('templates/header');
        $this->load->view('templates/success');
    }
    $this->load->library('pagination');
     $this->load->library('table');



      // …
Run Code Online (Sandbox Code Playgroud)

php codeigniter

1
推荐指数
1
解决办法
3万
查看次数

在.sql扩展中使用php代码导出数据库?

是否可以在.sql扩展中使用php代码导出数据库?

Example

database name : demodb

db contain two tables
table one : user
table two : registration
Run Code Online (Sandbox Code Playgroud)

php mysql

1
推荐指数
1
解决办法
7998
查看次数

选择带有值空格的SQL

我有一个像这样的php文件:

<?php define('AREA', 'C');
    require ('prepare.php');
    require ('init.php');
    $con = mysql_connect(Registry::get ( 'config.db_host' ), Registry::get ( 'config.db_user' ), Registry::get ( 'config.db_password' ))or die("Unable to connect to MySQL");
    mysql_select_db(Registry::get ( 'config.db_name' ));
     if (!empty($_POST['dealer_company']))
     {
         $dealerCompany = 'Your company'; //$_POST['dealer_company'];                
         $result = mysql_query("SELECT distinct a.firstname, a.lastname, a.email, a.user_id
     FROM cscart_users a,cscart_usergroup_links b, cscart_usergroup_descriptions c
     WHERE b.usergroup_id=c.usergroup_id and b.status = 'A' and a.user_id=b.user_id and   
         c.usergroup='Dealer' and a.company = 'Your company'",$con) or die(mysql_error());

        while($row = mysql_fetch_array($result))
        {
            $d_Infos[]=$row;            
        }
     }
     if (!empty($_POST['dealer_company']))
     { …
Run Code Online (Sandbox Code Playgroud)

php mysql sql sql-server

-2
推荐指数
1
解决办法
1563
查看次数

标签 统计

php ×3

mysql ×2

codeigniter ×1

sql ×1

sql-server ×1