dqxboe2628
dqxboe2628
2018-12-29 19:29

如何修复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()); 
} }
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doucang8303 doucang8303 3年前

    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 ...
    
    点赞 评论 复制链接分享