插入多行无效

时间:2016-06-24 11:08:33

标签: php sybase

我无法使这个插入工作。谁能告诉我哪里做错了?

$id_application = 1;
foreach ($array_account as $rows) {
    $e_mail = $rows["EMAIL"];
    $pwd = $rows["PWD"];
    $salt = $rows["SALT"];

    $values = "(" . $e_mail . ", " .$pwd . ", " .$salt .  ", " . $id_application . ")";  
    $query = "INSERT INTO DBNAME..ACCOUNT (EMAIL, PWD, SALT, ID_APPLICATION) "
    . " VALUES " . $values;
    $result = sybase_query($query);    
}

这些是错误:

Column names are illegal. (severity 15, procedure N/A
The identifier that starts with '...' is too long. Maximum length is 30
The name '...' is illegal in this context. Only constants, constant expressions, or variables 
allowed here

我能够在sybase中心插入一行,如:

insert into DBNAME..ACCOUNT (EMAIL, PWD, SALT, ID_APPLICATION)  
select EMAIL, PWD, SALT, 3 from ACCOUNT  where ID = 10 go

1 个答案:

答案 0 :(得分:0)

Do this $values = "('" . $e_mail . "', '" .$pwd . "', '" .$salt .  "', '" . $id_application . "')";