<--! HTML -->
<div class="tk" data-amount="40">
40%
<div class="lq"></div>
</div>
The "data-amount" variable and the label in the example->"40" needs to be pulled from the data base. Please explain best way to accomplish this?
If you have custom data to be extracted from the database without the need for a bidirectional SQL cursor, then I suggest that you use a simplequery component. You can set the SQL for select directly or use the SQL designer to have it generated for you. (use the query property for the visual designer, the SQL property for the SQL statement. You can do this in PHP as well.
Suppose you want to display the HTML in the label value component. Then use the onbeforerender event of the label to apply your code.
Put a simplequery component on your form. I usually rename the component to q. Put a label component on your form.
Open the onbeforerender event on your label_1
$$q->setSQL('select * from mytable where mykey=:myk');
$$q->setStringFieldByName(':myk', $mysearch);
$myrow=$$q->simpleOpen(true); // retrieves first row, convenient if you expect only one row.
$field1=$myrow['amount'];
$this->value=<build your html statement here>;
I'm not sure what you want to achieve, but it might be that a chart component could do the job?