CodeIgniter和Oracle [英] CodeIgniter and Oracle
本文介绍了CodeIgniter和Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好!
我正在尝试使用CodeIgniter添加到oracle数据库.
下面的代码是要添加到数据库中的查询:
Hi guys!
I am trying to add to oracle database using CodeIgniter.
Code below is the query to add to the database:
<?php <br mode="hold" /?>class System_model extends Model// this is the model class that all query statement are excecuted
{
function insertNewNationality($nationality)
//function to add new nationality to the cvdb
{ //note: cvdb is the name of the database
$data=array(''nationality''=>$nationality);//column name in the nationality_ids table
$this->db->insert(''nationality_ids'',$data);//query statement to insert value to nationality_ids table the cvdb
}
?>
使用CodeIgniter进行编码时,通常我们将具有三个不同的文件夹:
一个是Controller,另一个是View,最后一个是Model.模型是所有查询功能所在的地方.
在我的视图中,当我尝试向oracle数据库添加值时,出现此错误:
When coding using CodeIgniter, normally we will have three different folders:
One is Controller another one is View and last one is Model. Model is where all query function are.
In my View when I try to add value to the oracle database i get this error:
A Database Error Occurred
Error Number:INSERT INTO "gender_ids" ("gender") VALUES (''male'')
谁能帮助我:(
Can anyone help me please :(
推荐答案
国籍) //用于向cvdb添加新国籍的功能 {//注意:cvdb是数据库的名称
nationality) //function to add new nationality to the cvdb { //note: cvdb is the name of the database
data = array(''nationality''=& gt;
data=array(''nationality''=>
国籍) ;//nationality_ids表中的列名
nationality);//column name in the nationality_ids table
这篇关于CodeIgniter和Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文