这是mu query

$sql_query= "insert into shortdb1.currency_code set currency_code = 'KWD',
based_on = 'KWD', currency_rate = '1.00',
last_update = '2013-07-25 11:41:33';
insert into shortdb1.currency set currency_code = 'KWD',
language_code = 'EN', currency_name = 'Kuwaiti Dinar';";


    $conn_1->query($sql_query)

但我犯了错误
您的SQL语法有错误;请查看对应于MySQL服务器版本的手册,在第4行“insert into shortdb1.currency set currency_code = 'KWD', language_code = 'EN','附近找到正确的语法

最佳答案

您的查询需要存储为字符串,即:

$sql_query = insert into shortdb1.currency_code set currency_code = 'INR', based_on = 'KWD', currency_rate = '200', last_update = '2013-07-25 11:14:26';

必须是
$sql_query = "insert into shortdb1.currency_code set currency_code = 'INR', based_on = 'KWD', currency_rate = '200', last_update = '2013-07-25 11:14:26'";

关于php - 如何将多个查询作为一个更新,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17853066/

10-11 07:15