help understanding mydacs and getting a count from db tables

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Thunder
Posts: 3
Joined: Mon 19 Jan 2009 11:31

help understanding mydacs and getting a count from db tables

Post by Thunder » Mon 19 Jan 2009 11:35

I been trying to get a count from my db of my rooms in each lobby group in my db but am unsure on what component to use to get the command to find out the count

am doing the following in the MyCommand but i dont no if that is the correct component to use?

Code: Select all

   Command.SQL.Text := ('select count(*) as room_count from groups left join rooms on groups.n = rooms.id where groups.n = ' + IntToStr(r));
   Command.Execute;
can any one help me ?

thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 19 Jan 2009 14:16

You can use the TMyQuery component for this purpose.

Code: Select all

MyQuery.SQL.Text := ...
MyQuery.Execute;

Post Reply