I am getting strings from 3 dirrernt fields from a mySql database.
It works good enough just to get 1 row. I need to display all of the (comments) field in a Listview.
Here is mySql Code.
I am trying to fetch all the fields in a table and display (home,opp) in 2 textedits, and comments in a litview.
Here is B4A code that i am trying to figure out how to loop through the listview and add the mySql field (comments) into.
This just shows 1 row of the Field (comments)
Any help and comments are appreciated.
Thanks for your time and help.
It works good enough just to get 1 row. I need to display all of the (comments) field in a Listview.
Here is mySql Code.
B4X:
if ( isset($_GET['action']) && $_GET['action'] == "get_scores" ) {
$query_scores = "SELECT home,opp,comments FROM mysqlscore";
$result_scores = mysql_query($query_scores) or die(mysql_error());
$row_scores = mysql_fetch_assoc($result_scores);
$home = $row_scores['home'];
$opp = $row_scores['opp'];
$comments = $row_scores['comments'];
echo $home.','.$opp.'-'.$comments;
I am trying to fetch all the fields in a table and display (home,opp) in 2 textedits, and comments in a litview.
Here is B4A code that i am trying to figure out how to loop through the listview and add the mySql field (comments) into.
B4X:
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim res As String
Dim home As String
Dim opp As String
Dim comments As String
Dim listcount As Int
Dim listvalue As String
res = Response.GetString("UTF8")
Log("Response from server: " & res)
home = res.SubString2(0, res.IndexOf(","))
opp = res.SubString2(res.IndexOf(",")+1, res.IndexOf("-"))
comments = res.SubString2(res.IndexOf("-")+1, res.Length())
Label2.Text = home
Label1.Text = opp
listcount = 1
For I = 1 To listcount
ListView1.AddSingleLine(comments)
Next
Response.Release
End Sub
This just shows 1 row of the Field (comments)
Any help and comments are appreciated.
Thanks for your time and help.
Last edited: