mwambembela
Forum Replies Created
-
Forum: Plugins
In reply to: [Super Page Cache] Caching Issue On My SiteBut it still not updating, the problem is still there.
Forum: Plugins
In reply to: [Super Page Cache] Caching Issue On My SiteAny update on this?
Forum: Plugins
In reply to: [Super Page Cache] Caching Issue On My SiteHere it is, can you go through it?
Forum: Plugins
In reply to: [Super Page Cache] Caching Issue On My SiteShould i use any Log Plugin? Or which one do you suggest?
Forum: Plugins
In reply to: [Super Page Cache] Caching Issue On My SiteI tried to make changes as suggested above and add a test product but nothing has changed.
Forum: Plugins
In reply to: [WooCommerce] Product Regular Price ModificationThanks a lot for your recommendation Shameem, Be Blessed.
Thank you for your reply, but too good it worked out now without any extra customization.
What code should i use? I tried to hide the form class with CSS but too bad it hide even sections that are not part of it.
Those CSS codes does not work
LOL
Let me try to update it.
The response I get when I run this query
select * from wp_users where ID = @wpda_wp_user_id select @wpda_wp_user_id
in Query Builder, it says
ERROR: Invalid query
.If I need to get the value of $current_user from another source how can accomplish that please advise.
I’m using localhost with MySQL version 5.2 if I’m not wrong.
And This is how i assigned Department Value to
@$dept
Session Variable, but even if i use the Session Variable@$dept
query it return nothing.add_action( 'wpda_dbinit', function( $wpdadb ) { if ( null !== $wpdadb ) { $suppress_errors = $wpdadb->suppress_errors( true ); $current_user = wp_get_current_user(); $wpdadb->query( 'set @dept = "' . $current_user->Department . '"' ); $wpdadb->suppress_errors( $suppress_errors ); } }, 10, 1 );
Hi @peterschulznl here I am again
I tried to use Session Variable Method,
So in my database, I have a table named wp_users, I executed this queryselect * from wp_users
it listed all table columns with their value, then I added the WHERE Clause the query read like thisselect * from wp_users where ID = @wpda_wp_user_id
but it’s strange when I add the WHERE Clause no any data is output as seen in the picture I attached in the link below. Where might be the problem? I thought maybe it’s a WordPress naming scheme so I tried to change this@wpda_wp_user_id
to@wp_wpda_user_id
but nothing changed.Looking forward to hearing from you.
Thanks @peterschulznl let me get into it and see how it will come out
Hi @kimmyx i tried my below codes as you explained in your above codes but too bad it did not work out.
Here is my query below
SELECT P.ID, MAX(IF(PM.meta_key = 'first_name', PM.meta_value, NULL)) AS Name, MAX(IF(PM.meta_key = 'last_name', PM.meta_value, NULL)) AS Last, MAX(IF(PM.meta_key = 'Gender', PM.meta_value, NULL)) AS Gender, MAX(IF(PM.meta_key = 'Department', PM.meta_value, NULL)) AS Department, MAX(IF(PM.meta_key = 'position_title', PM.meta_value, NULL)) AS Dpt, MAX(IF(PM.meta_key = 'region', PM.meta_value, NULL)) AS Region, MAX(IF(PM.meta_key = 'district_dar', PM.meta_value, NULL)) AS District, MAX(IF(PM.meta_key = 'status_av', PM.meta_value, NULL)) AS Status FROM wp_users AS P LEFT JOIN wp_usermeta AS PM on PM.user_id = P.ID WHERE P.ID in (select user_id from wp_usermeta where meta_key='Department' and (meta_value = '$dept')) and P.ID in (select user_id from wp_usermeta where meta_key='status_av' and meta_value = 'on') group by P.ID
Variable name is $dept in meta value below.
And this is how i declared it within function.php so it can be accessible on the site.
global $current_user; get_currentuserinfo(); $dept = $current_user->Department;
Where do you think i’m doing wrong??
$dept value from functions is supposed to be used in query when listing datas.Thanks.
- This reply was modified 2 years, 1 month ago by mwambembela.
- This reply was modified 2 years, 1 month ago by mwambembela.
- This reply was modified 2 years, 1 month ago by mwambembela.