douxi1968 2015-09-22 19:48
浏览 42

CodeIgniter - 我的插入查询不起作用 - 返回没有错误号的错误

I am using CodeIgniter to insert a new record to an Oracle table in php. THe code is on the below:

public function insert_street_file( $insdata = null )
    {
        if ($insdata == null)
        {
            // return false;
        }
        else
        {
            $insdata = array(
            'NAME'=>"Eray",
            'SURNAME'=>"BAlk",
            'CITY'=>"HALIFAX",
            'PROVINCE'=>"NS",
            'LSTNOLO'=>1,
            'LSTNOHI'=>2,
            'RSTNOLO'=>3,
            'RSTNOHI'=>4,
            'POSTCODE'=>"b3h1s8",
            'POSTDIR'=>"1s8",
            'PREDIR'=>"b3h",
            'STR_CODE'=>30002
        );

$results =$this->oracle_db->insert("$this->street_file_table_name", $insdata);
return $results;

And i am getting the error below:

Error Number: 

INSERT
INTO People
     ("NAME", "SURNAME", CITY", "PROVINCE", "LSTNOLO", "LSTNOHI",
      "RSTNOLO", "RSTNOHI", "POSTCODE", "POSTDIR", "PREDIR", "STR_CODE")
 VALUES ('Eray', 'Balk', 'Halifax', 'NS', 1, 2,
     3, 4, 'b3h1s8', '1s8', 'b3h', 30002)

Filename: C:\inetpub\ci-2-1-3-system\database\DB_driver.php
Line Number: 330
  • There is no error number specified, so I don't know what exactly the problem is.
  • DB connection is provided, any select query works well.
  • $this->street_file_table_name value is correct
  • column names are also in capital letters in the Oracle db. All column names and table name are good.

I appreciate if you help me solve this issue.

Edit: The missing quotes were typos. It is not the real problem.

  • 写回答

1条回答 默认 最新

  • dpxw7293 2015-09-22 19:52
    关注

    You have syntax error. Appostrophe missing use

    'NAME'=>"Eray",
    

    instead of

    'NAME=>"Eray",
    
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?