Jump to content

How to do a page counter that record automatically in a MySql table


SergioFeitoza

Recommended Posts

4 hours ago, Sherzod said:

Hello,

Sorry, does it matter to UniGUI?

Hi Sherzod  . It sounds strange but it is Unigui. Please forget the words Linkedin and Instagram.

My question is related to my engineering code that I will put in the air today or tomorrow.  I could deploy it and I am doing only final adjustments. I will post the working link here in few days.

About my question, What I need to do in to create - from the very beginning - a CHART that show me the evolution of the number of persons which REGISTER in my page. I will leave the software as free for 3 months to detect unavoidable bugs. . The main thing is working well.

To do this chart  is very easy to do manually inserting the values in a table However I want to do the update the table (basis for the chart)  automatically in the moment that  the person register in the LoginPage

Let me put the question in another way.

Is it possible to insert a counter in my Unigui code which automatically save he daily  number of registered users values in a table?

Regards

 

*******   RON: tomorrow I will test and answer you  Thanks a lot Seems to be reat

Deployed.png

Link to comment
Share on other sites

  • SergioFeitoza changed the title to How to do a page counter that record automatically in a MySql table
21 hours ago, SergioFeitoza said:

Let me put the question in another way.

Is it possible to insert a counter in my Unigui code which automatically save he daily  number of registered users values in a table?

 

Hi, why not ?

If you create a global counter in uniServerModule and save when the max session.count is greater than the Counter value, then at 23:59 of the day you can save the Counter value and start from scratch again for the next day.

something like that:

uniServerModule

var 

GlobalCounter : Int64;

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin

GlobalCounter := 0;

end;

TUniMainModule

procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);
begin

Inc (GlobalCounter);

//OR 

// IF UniServerModule.SessionManager.Sessions.SessionList.Count > GlobalCounter then Inc (GlobalCounter);

end;

 

You need to find a way to keep the Counter value at 23:59 for the day

May by uniThreatTimer on uniServerModule to know when 23:59 is.

 

Link to comment
Share on other sites

10 minutes ago, irigsoft said:

Hi, why not ?

If you create a global counter in uniServerModule and save when the max session.count is greater than the Counter value, then at 23:59 of the day you can save the Counter value and start from scratch again for the next day.

something like that:

uniServerModule

var 

GlobalCounter : Int64;

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin

GlobalCounter := 0;

end;

TUniMainModule

procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);
begin

Inc (GlobalCounter);

//OR 

// IF UniServerModule.SessionManager.Sessions.SessionList.Count > GlobalCounter then Inc (GlobalCounter);

end;

 

You need to find a way to keep the Counter value at 23:59 for the day

May by uniThreatTimer on uniServerModule to know when 23:59 is.

 

Hi irigsoft. Thank you very much .  I will try to use the concept . 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...