当我插入数据然后浏览表时,我有这个 osclass 表,数据已经输入了两次,所以我得到了同一个表的两个 id。
CREATE TABLE /*TABLE_PREFIX*/t_table_log(
pk_i_id INT NOT NULL AUTO_INCREMENT ,
fk_i_user_id INT NULL ,
fk_i_item_id INT NULL ,
s_email VARCHAR( 200 ) NULL ,
s_status VARCHAR( 20 ) NOT NULL ,
PRIMARY KEY(pk_i_id)
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';
这是我的 php 代码
$conn = getConnection();
$conn->osc_dbExec("INSERT INTO %st_table_log (fk_i_item_id, fk_i_user_id, s_email, s_status ) VALUES ('".$_SESSION['itemid']."','".$_SESSION['userid']."','".$response['senderEmail']."','".$response['status']."')", DB_TABLE_PREFIX) ;
$item_url = osc_item_url() ;
$name = osc_page_title() ;
$subject = (__("Hello",'osclass'));
$email = osc_logged_admin_email();
$messagesend =" my message";
$params = array(
'subject' => $subject
,'to' => $email
,'to_name' =>$name
,'body' => $messagesend
,'alt_body' => strip_tags($messagesend)
) ;
osc_sendMail($params) ;