このコードを使用して$cordovaSQLite
の挿入を実行しました。
var qst_master_content_data= {
qst_cnt_id :content.qst_cnt_id,
question_id :content.question_id,
qst_cnt_text :content.qst_cnt_text,
qst_cnt_options :content.qst_cnt_options,
qst_story:content.qst_story,
explanation :content.explanation,
lang_id :content.lang_id,
img_id :content.img_id,
dt_update :content.dt_update
};
var query = "INSERT INTO qst_master_content ("+
"qst_cnt_id, "+
"question_id, "+
"qst_cnt_text, "+
"qst_cnt_options, "+
"qst_story, "+
"explanation, "+
"lang_id, "+
"img_id, "+
"dt_update "+
") VALUES (?,?,?,?,?,?,?,?,?)";
$cordovaSQLite.execute(db, query, qst_master_content_data).then(function(res)
{
console.log(res);
},
function(err)
{
console.log(err);
}
残念ながら、挿入が正常に挿入されませんでした。 qst_master_cotent = [1,2,3];
を使用しようとしましたが、それは問題ありません。 しかし、これは自分のコードをその形式で再利用することはできません。それは次のようになります:
var qst_master_content_data= {
qst_cnt_id :content.qst_cnt_id,
question_id :content.question_id,
qst_cnt_text :content.qst_cnt_text,
qst_cnt_options :content.qst_cnt_options,
qst_story:content.qst_story,
explanation :content.explanation,
lang_id :content.lang_id,
img_id :content.img_id,
dt_update :content.dt_update
};
私は将来データを操作することができます。私はそれをどのようにすることができますか?
、私が意味することは、私が問題になっているように私自身の配列をしたいでした。 – Nere
おそらく、その(キー、値)ペアオブジェクト –
はい、問題が発生していますが、それは[1,2,3、..]のようなパラメータ配列上の唯一の方法ですか? – Nere