小编spa*_*mup的帖子

sqlite3.Warning:您一次只能执行一条语句

运行此代码时出现错误:

import sqlite3

user_name = raw_input("Please enter the name: ")
user_email = raw_input("Please enter the email: ")

db = sqlite3.connect("customer")
cursor=db.cursor()

sql = """INSERT INTO customer
        (name, email) VALUES (?,?);, 
        (user_name, user_email)"""

cursor.execute(sql)
Run Code Online (Sandbox Code Playgroud)

为什么会这样?

python sqlite

11
推荐指数
3
解决办法
2万
查看次数

php代码中的标头重定向不起作用

我想通过电子邮件发送给我后重定向用户.
代码运行,除非我在email()-method 之后放了一些东西(比如header()-method).
任何提示?

function process()
{
    $msg = "Form Contents: \n\n";
    foreach($this->fields as $key => $field)
        $msg .= "$key :  $field \n";

    $to = 'mymail@gmail.com';
    $subject = 'thesubject';
    $from = $this->fields['email'];

    mail($to, $subject, $msg, "From: $from\r\nReply-To: $from\r\nReturn-Path: $from\r\n");

    header('Location: thanks.html');
}
Run Code Online (Sandbox Code Playgroud)

php http-redirect http-headers

0
推荐指数
1
解决办法
6881
查看次数

标签 统计

http-headers ×1

http-redirect ×1

php ×1

python ×1

sqlite ×1