English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 1
TOPIC: Create User View With Females Only
#7840
Create User View With Females Only 13 Years, 4 Months ago Karma: 0
I have jms installed along with jomsocial and AEC. I'm setting up an affiliate network.
I would like to show only female users on one of the clones.
I'm having trouble when trying to create or replace the community_users view with my own because views created with subqueries or unions use a temp table and make a non updatable view.

I was wondering if you have any tips or tricks you can share with me to create a clone that only shares users that are female? Below is the code to create the view.

Code:

CREATE OR REPLACE VIEW child.child_community_users AS
SELECT 
u.userid,status,status_access,points,posted_on,avatar,thumb,invite,params,view,
friendcount,alias,latitude,longitude,profile_id,storage,watermark_hash,search_email,
friends,groups
FROM master.`master_community_users` AS u
JOIN master.master_community_fields_values AS fv ON fv.user_id = u.userid
WHERE fv.field_id = 2 AND fv.value = 'Female' 

oasisfleeting
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/08/16 00:17 By oasisfleeting.
The administrator has disabled public write access.
 
#7849
Re:Create User View With Females Only 13 Years, 4 Months ago Karma: 0
Any suggestions at all?
oasisfleeting
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7857
Re:Create User View With Females Only 13 Years, 4 Months ago Karma: 54
If you read the MySQL documentation, you will see that complex view can never be updated.
In your case, you perform a join that is potentially the problem.

Only basic select * from table can be updated. You can sometime use a where clause but a very basic one.

So you can not do such complex view if you want to be able insert, update, delete records.

Something that may perhaps work is

select * from table where x not in select * from table2 where ....

This avoid to use a join but this is probably slower.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7861
Re:Create User View With Females Only 13 Years, 4 Months ago Karma: 0
I'll just break the queries down in to small bits and do all the id logic with php.

...
oasisfleeting
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/08/19 15:14 By oasisfleeting.
The administrator has disabled public write access.
 
#7866
Re:Create User View With Females Only 13 Years, 4 Months ago Karma: 0
it works.
oasisfleeting
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla