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 `#__garden_mygardenplants` AS a '
. ' LEFT JOIN `#__users` AS _gardener_ ON _gardener_.id = a.gardener'
. ' LEFT JOIN `#__garden_mygarden` AS _mygarden_ ON _gardener_.id = a.mygarden'
. ' LEFT JOIN `#__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