Welcome, Guest
Username: Password: Remember me

TOPIC: SQL Query - sort of off topic - but not.

SQL Query - sort of off topic - but not. 05 Feb 2012 09:50 #1175

  • iconvisual
  • iconvisual's Avatar
  • Offline
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
  • Karma: 1
Hi All,

trying to struggle with what should be a simple SQL solution. Apologies that this isn't 100% related to j-cook however it's part of my j-cook projects.

I need to work with 2 Tables; jos_users and my own jos_easypropmgr_landlords. Now due to my poor planning I do not have a relationship between the two, and I should - I need one.

Keep in mind that I'm working with legacy (existing system) data.

Every landlord needs to be a jos_user.

So with jos_easypropmgr_landlords I have a landlord_id which already exists (legacy) and a landlord_emailaddress (same).

With the exception of the 'admin' user in jos_users I could easily trash all records in the existing jos_users table.

Should I perform some sort of sync where I use an UPDATE SQL or INSERT so that the jos_users Table is rebuilt with a jos_users.id = landlord_id? And could some kind soul tell me how to do so with SQL please?? (Im a noob).

Or is there a better way to ensure that I can achieve:
SELECT
					landlord_id
				FROM
					jos_easypropmgr_landlords
				WHERE
					landlord_id = {the jos_users.id of current user logged in}
				LIMIT
					1

Sorry for long post, and sincerely appreciate any suggestions.

Kind Regards,

Edward.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.
The administrator has disabled public write access.
Time to create page: 0.094 seconds

Get Started