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.064 seconds

Amazing Tool !
And only tool I know that allows complete Scaffolding in terms of component creation. It really saves loads of time (actually much more than that). Simple architecture enables quick and painless changes at any time. Code is clean and consintent. It's just... what's the word... neat! :) Great work! You should definetely try this one!

pi_wo (JED)
         

Get Started