1
I have 2 tables;
[links]
id
link
clicks
Exemplo de Link cadastrado
ID link clicks
1 http://www.google.com NULL
2 http://www.gmail.com NULL
[users]
id
nome
email
Exemplo de user cadastrado
ID NOME EMAIL
400 XXXXXXXXX [email protected]
100 AAAAAAAAAA [email protected]
250 DDDDDDDDD [email protected]
When the user clicks on a link, it arrow that user id clicked it, adding the id inside the "clicks" field, getting:
ID link clicks
1 http://www.google.com 400
If another click also on the same link, it looks like this:
ID link clicks
1 http://www.google.com 400, 250
If another click again on the same link, it looks like this:
ID link clicks
1 http://www.google.com 400, 250, 100
And so with the other links etc.
What I need is via PHP and Mysql to know for example, everyone who clicked on the gooogle.com.br link showing his name and email address.
Honestly I’m not getting to think about the structure of the code and logic.
It would be better to create another table, for example
links_click
, by clicking save in this table the link code, user code, click date and time etc, and when you want to know who clicked just make a query in this table making the Join with link and users.– abfurlan
Yes, but the system already exists, I can’t change it now....
– Roberta
@Roberta Take a little time to evaluate the answers that colleagues have given their Questions . If the answer helped somehow Vote , if solved its accepted problem.
– rubStackOverflow