使用PHP服务创建的重复记录

时间:2011-08-05 14:12:21

标签: flex flex4

在什么情况下,以下行会创建两个记录而不是一个?

该行只运行一次,我追踪该程序以确保。

createIndcsfResult.token = indcsfService.createIndcsf(indCSF2);

标准服务

/**
 * Returns the item corresponding to the value specified for the primary key.
 *
 * Add authorization or any logical checks for secure access to your data 
 *
 * 
 * @return stdClass
 */
public function createIndcsf($item) {

    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (indcsf_name, indcsf_yourcsf_id, indcsf_status) VALUES (?, ?, ?)");
    $this->throwExceptionOnError();

    mysqli_stmt_bind_param($stmt, 'sis', $item->indcsf_name, $item->indcsf_yourcsf_id, $item->indcsf_status);
    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);     
    $this->throwExceptionOnError();

    $autoid = mysqli_stmt_insert_id($stmt);

    mysqli_stmt_free_result($stmt);     
    mysqli_close($this->connection);

    return $autoid;
}

0 个答案:

没有答案