2

I would like to copy login data from one table to another.

  1. table contains Joomla login data
  2. table contains phpFox login data. I would like to copy login data from table 1 in every 30 seconds / 1 minute to table 2.
Ed Heal
  • 59,252
  • 17
  • 87
  • 127

3 Answers3

0

This is simple enough. Just write a query that does the action you want and save it as a .sql file. Then enter crontab -e at the command line to begin editing your crontab. The Ubuntu docs have good instructions for editing crontabs, but your final line will probably look something like:

* * * * *       mysql --user=your_dbuser --password=your_password --database=zero < /path/to/your_query.sql
Garry Cairns
  • 3,005
  • 1
  • 18
  • 33
  • I have wrote the sql commands, I run it, but I can not login with the data. They sais: wrong password. I can get a new password, but I can not login also with the new password. What should be the problem? – Kovács Ákos Feb 10 '13 at 10:05
  • I'm not a MySQL user so someone else may correct me here, but I suspect your database belongs to another user, probably a `MySQL` user that was created when you set up the database server. I've changed my answer so your crontab can handle that, but you'll need to find an supply the user and password relevant to your setup. The MySQL documentation should help you with that. – Garry Cairns Feb 10 '13 at 13:49
0

If you want to share users informations database from a master to other(s) Joomla website(s), there's a better solution.

The only requirement is all databases must be located on the same server + Joomla 2.5.x!

Open PhpMyAdmin and apply this modifications :

xxxx1... are tables from master site
xxxx2... are tables from client site

DROP TABLE xxxx2_session
DROP TABLE xxxx2_usergroups
DROP TABLE xxxx2_users
DROP TABLE xxxx2_user_notes
DROP TABLE xxxx2_user_profiles
DROP TABLE xxxx2_user_usergroup_map

CREATE VIEW xxxx2_users AS SELECT * FROM xxxx1.jos_users
CREATE VIEW xxxx2_session AS SELECT * FROM xxxx1.jos_session
CREATE VIEW xxxx2_usergroups AS SELECT * FROM xxxx1.jos_usergroups
CREATE VIEW xxxx2_user_notes AS SELECT * FROM xxxx1.jos_user_notes
CREATE VIEW xxxx2_user_profiles AS SELECT * FROM xxxx1.jos_profiles
CREATE VIEW xxxx2_user_usergroup_map AS SELECT * FROM xxxx1.jos_usergroup_map
Arnaud
  • 412
  • 6
  • 12
0

If you want to run cron from default phpfox function then see phpfox_cron table in your phpfox database.

keshu_vats
  • 452
  • 6
  • 45