![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Excel |
I am using an SQLite plugin for Godot so I’m not sure if this is the correct place to ask this but I have no idea why I am getting this error. Here is the script for more details.
extends Control
const SQLite = preload(“res://lib/gdsqlite.gdns”);
func _on_Button_pressed():
# Create gdsqlite instance
var db = SQLite.new();
# Open database
if (!db.open_db("res://ShapeBase.db")):
print("Cannot open database.");
return;
var usernametext = get_node("MarginContainer/VBoxContainer/HBoxContainer/Username").get_username()
print(usernametext)
var passwordtext = get_node("MarginContainer/VBoxContainer/HBoxContainer2/Password").get_password()
print(passwordtext)
db.query("CREATE TABLE IF NOT EXISTS user (userid INTEGER PRIMARY KEY, username TEXT, password TEXT, dateofbirth TEXT, emailaddress TEXT, numberofsimulations INTEGER);");
while usernametext != null:
db.query("INSERT INTO user (username) VALUES (?);"[usernametext]);