我正在使用 Node JS 在 MySql 数据库中执行插入操作。
我检查了 INSERT 的结果,一切顺利。
我在查询结果中使用 var resultId 来检查数据库中插入的最后一个 id,但在这种情况下,我将多行插入到数据库中,并且我的 resultId 具有第一个插入的值。
节点 Js 中是否存在可以使用的东西,我可以看到所有插入的 resultId?
谢谢
我在函数外部有一个变量,我需要更改该值。我通常使用“this”来访问变量,但在代码的那个点,“this”是不可访问的。
export class GamesDetailPage {
details : any = {};
type : String;
level : Number;
cards : any = {}; // THE VARIABLE I WANT TO SET THE VALUE
constructor(public navCtrl: NavController, public http: HttpClient , private device: Device, private serviceProvider: ServicesProvider,
public navParams: NavParams
) {
this.type = navParams.get('gameType');
this.level = navParams.get('gameLevel');
}
ionViewDidLoad() {
this.getCards(); // WHERE I CALL THE METHOD
}
getCards(){
var deviceUUID = this.device.uuid;
var platform = this.device.platform;
var cardsReq = {"gameType": this.type ,"gameLevel": …Run Code Online (Sandbox Code Playgroud)