Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • iconvisual
  • iconvisual's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
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.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.048 seconds

This Component Generator is the REAL component generator. This tool is very easy to use and in a matter of minutes I was building a fully working extension. I was amazed with the end result... worth every cent...
Griiettner (JED)

         

Get Started