Hi,
I am retrieving data from a mysql database via php and displaying it like this:
for($i = 0; $i < $num_results; $i++)
{
@$row = mysql_fetch_array($result);
echo @$row['tower'] . "\r";
echo @$row['grid'] . "\n";
}
I then need to split this data so that it can be used, I thought about using a 2D array but couldnt figure out how to use it so I did it this way:
string[] lines = Regex.Split(retrieve.text, "\n");
foreach (string line in lines)
{
string[] datas = Regex.Split(line, "\r");
Debug.Log("Tower : " + datas[0]);
Debug.Log("Grid : " + datas[1]);
}
this way works but it produces the following error:
IndexOutOfRangeException: Array index is out of range.
I think it is because the last part of the array is empty, any ideas how I can solve this or implement my original idea of a 2D array?
Thanks