Post by jayantha on Dec 8, 2022 23:48:44 GMT
error
SQLiteException: near "FROM": syntax error
SimpleSQL.SQLite3.Prepare3 (System.IntPtr db, System.String query) (at <9d351781d88446ec91fb4a6de237d175>:0)
SimpleSQL.SQLiteCommand.Prepare3 () (at <9d351781d88446ec91fb4a6de237d175>:0)
SimpleSQL.SQLiteCommand.ExecuteQueryGeneric () (at <9d351781d88446ec91fb4a6de237d175>:0)
code
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using SimpleSQL;
public class showtable2 : MonoBehaviour
{
public Text NameTxt;
public SimpleSQLManager dbase;
// Start is called before the first frame update
void Start()
{
// Gather a list of indexnumbers and their names pulled from the mytable table
SimpleSQL.SimpleDataTable dt = dbase.QueryGeneric(
"SELECT " + "stuname, " +
"FROM " + "mytable " +
"ORDER BY " + "stu_index "
);
//
//
NameTxt.text = "mytable\n\n";
int rowIndex = 0;
foreach (SimpleSQL.SimpleDataRow dr in dt.rows)
{
NameTxt.text += "<color=#1abc9c>Name:</color> '" + dr[1].ToString() + "' " +
"<color=#1abc9c>Damage:</color>" + dr["stuname"].ToString() + " " +
"<color=#1abc9c>Cost:</color>" + dr[3].ToString() + " " +
rowIndex++;
}
}
void Update()
{
}
}
SQLiteException: near "FROM": syntax error
SimpleSQL.SQLite3.Prepare3 (System.IntPtr db, System.String query) (at <9d351781d88446ec91fb4a6de237d175>:0)
SimpleSQL.SQLiteCommand.Prepare3 () (at <9d351781d88446ec91fb4a6de237d175>:0)
SimpleSQL.SQLiteCommand.ExecuteQueryGeneric () (at <9d351781d88446ec91fb4a6de237d175>:0)
code
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using SimpleSQL;
public class showtable2 : MonoBehaviour
{
public Text NameTxt;
public SimpleSQLManager dbase;
// Start is called before the first frame update
void Start()
{
// Gather a list of indexnumbers and their names pulled from the mytable table
SimpleSQL.SimpleDataTable dt = dbase.QueryGeneric(
"SELECT " + "stuname, " +
"FROM " + "mytable " +
"ORDER BY " + "stu_index "
);
//
//
NameTxt.text = "mytable\n\n";
int rowIndex = 0;
foreach (SimpleSQL.SimpleDataRow dr in dt.rows)
{
NameTxt.text += "<color=#1abc9c>Name:</color> '" + dr[1].ToString() + "' " +
"<color=#1abc9c>Damage:</color>" + dr["stuname"].ToString() + " " +
"<color=#1abc9c>Cost:</color>" + dr[3].ToString() + " " +
rowIndex++;
}
}
void Update()
{
}
}