I have a table in a local database which contains a mini-Market Stock data .svc inport.
I need to take all the database information, and set it in a unity table.
I want to create a prefab containing 4 text-fields and setting the database info in those fields, and create 1 prefab for each array(there is 1 array for each line on the database)
Here is my script
public string[] items;
// Use this for initialization
IEnumerator Start ()
{
WWW itemsData = new WWW ("http://localhost/inventario_iraule/Leer_Stock_Ropa_2016.php");
yield return itemsData;
string itemsDataString = itemsData.text;
//print (itemsDataString);
items = itemsDataString.Split (';');
for (int i = 0; i < items.Length; i++)
{
print (GetDataValue (items *, "Rotulos_fila:"));*
-
}*
- }*
- string GetDataValue(string data, string index)*
- {*
-
string value = data.Substring (data.IndexOf (index) + index.Length);*
-
if(value.Contains("|"))value = value.Remove (value.IndexOf ("|"));*
-
return value;*
- }*
Okey, i get all the data, and i have a index to search about specific data, but… i don’t know how to continue with these…
expected that the solution was creating 1 Php file for each column in the database, for filter all the information, but i’m sure there’s a easier way to do it.
My objective is to show all the database info organized in unity. And i don’t know how to “separate” the whoole array in a lot of game-objects(prefabs) or Text-fields.
Thank you so much for reading.
Hope someone can help me