using table classes in a custom page

Hi,
How I can use specific table classes in a custom page . I have a database table named as “exercises” and also a custom php file named as “ex.php”.
I want to use exercises table classes in this custom page .
How I can include exercises table classes in the custom page?

thanks
Mansour

You may just use it directly as the table and page classes are autoloaded (assume v2020), e.g.

$exercises = new exercises;

Hi,
Thank you for answer.
How may I return specific record data from that table. I have the primary key of that record.
e.g:
I need to print out “attached_photo” field value of the record number X
$exercises = new exercises;
echo $exercises->attached_photo->ViewValue();
??
Thanks

If you just want to return the data from a table, it is much easier to just execute the SQL and return the data. For example:

$value = ExecuteScalar(“SELECT Field FROM Table WHERE Key = …”);

mansour wrote:

echo $exercises->attached_photo->ViewValue();

should be:
echo $exercises->attached_photo->ViewValue;

mansour wrote:

$exercises = new exercises;
echo $exercises->attached_photo->ViewValue;

ViewValue does not have any value in the instance of the table class until you load a record.