第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

當(dāng)我在數(shù)據(jù)庫名稱中插入數(shù)據(jù)時,我的代碼有什么問題是 db2 它給了我一個錯誤列“名稱”不能為空

當(dāng)我在數(shù)據(jù)庫名稱中插入數(shù)據(jù)時,我的代碼有什么問題是 db2 它給了我一個錯誤列“名稱”不能為空

PHP
有只小跳蛙 2021-09-18 20:22:40
我想在數(shù)據(jù)庫名稱db2中插入數(shù)據(jù)表名稱table1來自注冊表,但它給我以下錯誤,因為“列Name不能為空”,我不明白,請幫助我我的控制器名稱是Abc.php,代碼是<?phpdefined('BASEPATH') OR exit ('No direct script access allowed');class Abc extends CI_Controller {public function index(){      $this->load->database();      $this->load->model('Done');      $this->load->view('codingregi');                        $data = array(                          'Name'     => $this->input->post('name'),                          'Email'  => $this->input->post('email'),                          'Password' => $this->input->post('password'),                         'Gender'   => $this->input->post('gender')                          );           $this->Done->savingdata($data);         redirect('Abc/index');       }}?>型號名稱是Done.php和是 <?php    defined('BASEPATH') OR exit ('No direct script access allowed');    class Done extends CI_Model     {     public function savingdata($data)          {              //this array is used to get fetch data from the view page.           //$xyz = "insert into table1 values ('$name','$email','$password','$gender')";      //$this->db->query($xyz);       {          $this->db->insert('table1',$data);          $emp_id = $this->db->insert();        }         return emp_id;        }    }    ?>和注冊表名稱是 codingregi.php <!DOCTYPE html>    <html>    <head>    <title>registraion form</title>    </head>    <body>    <form method="POST" method="Abc.php">    Name:<input type = "text" name="name"><br></br>    email: <input type = "email" name="email"><br></br>    Password: <input type ="password" name="password"><br></br>    Gender: <input type ="radio" name="gender" value="male">Male            <input type ="radio" name="gender" value="female">Female<br></br>    <input type ="submit">    </form>    </body>以下是完整的錯誤描述錯誤編號:1048列“名稱”不能為空INSERT INTO table1( Name, Email, Password, Gender) 值 (NULL, NULL, NULL, NULL)文件名:C:/xampp/htdocs/CodeIgniter-3.1.10/CodeIgniter-3.1.10/system/database/DB_driver.php行號:691
查看完整描述

2 回答

?
藍(lán)山帝景

TA貢獻(xiàn)1843條經(jīng)驗 獲得超7個贊

在您的控制器中:


<?php

    defined('BASEPATH') OR exit ('No direct script access allowed');

    class Abc extends CI_Controller {

    public function index(){




          $this->load->view('codingregi');





          }


    public function save(){

        $this->load->database();

        $this->load->model('Done');

        $data = array(  

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

                  'Email'  => $this->input->post('email'),  

                  'Password' => $this->input->post('password'), 

                  'Gender'   => $this->input->post('gender')  


                  );  

        $this->Done->savingdata($data);

        redirect('Abc/index'); 


        }


    }

    ?>

在你看來


<form method="POST" action="<?= base_url() ?>/abc/save">


查看完整回答
反對 回復(fù) 2021-09-18
  • 2 回答
  • 0 關(guān)注
  • 213 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號