About the first option, how do i do it?
There are many user in my table and i need to filter it to specifically their data
The appropriate use of queries, as JD mentioned. Something like (don't know if this is valid SQL, let alone MySQL SQL):
// assuming you have a Bills table with ID, Year, Month, Total, Description, User fields....
// see note below on joins
SELECT ID, Year, Month, Total, Description FROM Bills WHERE User = 'steve';
Depending on MySQL functionality, you could put this into a stored procedure... or used a parametrised query
http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery#Parameters_in_TSQLQuery.SQLSomething like: (air code as well, does probably not compile):
StatementQuery.SQL.Text:='SELECT Year, Month, Total, Description FROM Bills WHERE User = :TheUserIWant;';
StatementQuery..params.parambyname('TheUserIWant').asstring := 'steve';
So, if, for example if steve logs in to his mysql database account, in the memo pad, it will display steve's recent payment and date, not others
How can i do it?
See above; it might be a good idea to link your records to a mysql user id, something like a table ElectricityUsers with fields ID, MySQLUserName.
Make the ID an autonumber/autoincrement field.
Now you get e.g.
ID MySQLUserName
2 Bill
3 Steve
18 John
... in this table you can also add his real name, birthdate, and other relevant info about that person.
Then you can store the numeric userid in all your tables instead of the full name:
eg
Bills table with ID, Year, Month, Total, Description, User fields....
becomes
Bills table with ID, Year, Month, Total, Description, UserID fields. UserID is the number for Steve
When a user logs in, you know his username. You can retrieve his ElectricityUsers.ID value and use that in all your queries.
I suggest you first try and get some database/Lazarus experience by going through the tutorials, e.g.
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1 on the wiki page, if you haven't already.
Good luck,
BigChimp