dqxboe2628
dqxboe2628
2018-12-29 19:29
浏览 131

如何修复oci_execute():ORA-00957:重复列名...? [关闭]

I'm trying to insert form value data to Oracle database But I get this error ... please help ... ?

if(isset($_POST['submit'])){

  $id = $_POST['id'];
  $username = $_POST['username'];
  $password = $_POST['password'];
  $nameen = $_POST['nameen'];
  $namear = $_POST['namear'];


echo $sql = "INSERT INTO TESTTABLE (ID,USERNAME,PASSWORD,NAMEEN,NAMEEN) VALUES (:id,:username,:password,:nameen,:namear)";
  $compiled = oci_parse($conn, $sql);

  oci_bind_by_name($compiled, ':id', $id);
  oci_bind_by_name($compiled, ':username', $username);
  oci_bind_by_name($compiled, ':password', $password);
  oci_bind_by_name($compiled, ':nameen', $nameen);
  oci_bind_by_name($compiled, ':namear', $namear);

  oci_execute($compiled);

  if (! oci_execute($compiled)) {
    var_dump(oci_error()); 
} }

图片转代码服务由CSDN问答提供 功能建议

我正在尝试将表单值数据插入Oracle数据库但是我收到此错误...请帮忙.. 。

  if(isset($ _ POST ['submit'])){
 
 $ id = $ _POST ['id']; 
 $ username =  $ _POST ['username']; 
 $ password = $ _POST ['password']; 
 $ nameen = $ _POST ['nameen']; 
 $ namear = $ _POST ['namear']; 
 \  n 
echo $ sql =“INSERT INTO TESTTABLE(ID,USERNAME,PASSWORD,NAMEEN,NAMEEN)VALUES(:id,:username,:password,:nameen,:namear)”; 
 $ compiled = oci_parse($ conn,  $ sql); 
 
 oci_bind_by_name($ compiled,':id',$ id); 
 oci_bind_by_name($ compiled,':username',$ username); 
 oci_bind_by_name($ compiled,':password',  $ password); 
 oci_bind_by_name($ compiled,':nameen',$ nameen); 
 oci_bind_by_name($ compiled,':namear',$ namear); 
 
 oci_execute($ compiled); 
 
  if(!oci_execute($ compiled)){
 var_dump(oci_error());  
}} 
   
 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doucang8303
    doucang8303 2018-12-29 19:49
    已采纳

    You have twice the same field, called « NAMEEN », in your INSERT statement :

    INSERT INTO TESTTABLE
    (ID,USERNAME,PASSWORD,NAMEEN,NAMEEN) VALUES ...
    

    You want :

    INSERT INTO TESTTABLE
    (ID,USERNAME,PASSWORD,NAMEEN,NAMEAR) VALUES ...
    
    点赞 评论

相关推荐