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

TOPIC:

extending users table 14 Jan 2012 06:32 #972

  • mossss
  • mossss's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 7
Hi, I have a table with a few extra details for users. The id for the table is equal to the id of the Users table. I thought it would just be a matter of duplicating the join in the models file for the view. I am trying to get the my_location field from the my_garden table.

This is my query:
$query = ' SELECT a.*'
	.	' , _gardener_.username AS `_gardener_username`'
	.	' , _mygarden_.mylocation AS `_mygarden_mylocation`'					
	.	' , _myplant_key_.foto_a AS `_myplant_key_foto_a`'
	.	' , _myplant_key_.epithet AS `_myplant_key_epithet`'
	.	' , _myplant_key_.english_name AS `_myplant_key_english_name`'
	.	' , _myplant_key_.german_name AS `_myplant_key_german_name`'
	.	' , _myplant_key_.thai_name AS `_myplant_key_thai_name`'
	.	' , _myplant_key_.flower_colour AS `_myplant_key_flower_colour`'

. $this->_buildQuerySelect()

. ' FROM `vs4go_garden_mygardenplants` AS a '
	.	' LEFT JOIN `vs4go_users` AS _gardener_ ON _gardener_.id = a.gardener'
	.	' LEFT JOIN `vs4go_garden_mygarden` AS _mygarden_ ON _gardener_.id = a.mygarden'	
	.	' LEFT JOIN `vs4go_garden_plants` AS _myplant_key_ ON _myplant_key_.id = a.myplant_key'

however I just get an error
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean

I cannot understand as really, in all ways, the users table and the my_garden table are identical.

any ideas?

thanks

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

Last edit: by admin.

Re: extending users table 14 Jan 2012 11:02 #984

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I don't remember very well. But I think there is nothing to do with your query wich seems ok.

It come from the model when the list is empty. (when it get count, for the pagination)
But I don't remember very well.

Does your original query working without warning ?

If you modify the query step by step, can you identify what statement could generate this ?

Mosss, you are good coder and I think you will find. I'm very busy if you want more functionalities.
I'm preparing the server migration now.

Thanks to understand. I really appreciate you participation on the forum, I'm infinitly grateful.
Coding is now a piece of cake

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

Re: extending users table 14 Jan 2012 16:56 #996

  • mossss
  • mossss's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 7
sure, do appreciate that you are busy.

but still struggling on this. The query works fine without the join to the mygarden table and the related select fields. The full query also works fine in phpmyadmin. I would have expected, even if there were no matching records in the joined table for it still to select the records from the FROM table.

I know this must be something really basic. I'll keep fighting it, I normally win in the end, but if you do have any thoughts of ways to pin down the problem, let me know.

thanks

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

Re: extending users table 15 Jan 2012 04:46 #999

  • mossss
  • mossss's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 7
ok, got it.

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

Re: extending users table 22 Feb 2012 17:54 #1435

Please tell me how you did it.
I have tried joined queries before but the didn't work. I've tried a view in the mysql database but this failed also.

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

  • Page:
  • 1
Time to create page: 0.084 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