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

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started