Hello,
i am trying to do a simple thing : select * from database where something=thing;
i want to use functions(in php) like mysql_fetch_assoc or mysql_fetch_row or mysql_fetch_array to manage the result of mysql query
for now i am trying(but is not what i really want) with
Label4.Caption := MyQuery1.Fields.Fields[2].AsString;
but gives me an error : "xxx" is not a valid floting point value.
can you give me an exemple how to manage the result of query?!
mysql result , fileld etc
-
- Posts: 451
- Joined: Wed 19 Jan 2005 09:59
You have to know the Fied type type.
You can either use variant (and don't have to bother of the field type), but this will slow down your project
Label4.Caption := vartostr(MyQuery1.Fields.Fields[2].Value);
or use the correct type
Label4.Caption := floattostr(MyQuery1.Fields.Fields[2].AsFloat);
It looks like your Field[2] is a float type ( and not a String ).for now i am trying(but is not what i really want) with
Label4.Caption := MyQuery1.Fields.Fields[2].AsString;
but gives me an error : "xxx" is not a valid floting point value.
You can either use variant (and don't have to bother of the field type), but this will slow down your project
Label4.Caption := vartostr(MyQuery1.Fields.Fields[2].Value);
or use the correct type
Label4.Caption := floattostr(MyQuery1.Fields.Fields[2].AsFloat);