Find Jobs
Hire Freelancers

Write a mysql query to update a single database entry

$10-30 USD

Completed
Posted over 7 years ago

$10-30 USD

Paid on delivery
I am running a function to update the status of a custom post type to 'pending' when the user role is changed to 'subscriber'. At the same time I need to update an entry in the database to correspond. The table to update is from the Events Manager plugin. (See the attached image) We need to set the DB table cell value to 0 to match the post update. (0 is pending, 1 is published, -1 is trash) Here's the function: //We need to set events that were published by expired users to 'pending' add_action( 'set_user_role', 'draft_demoted_user_events', 10, 2 ); function draft_demoted_user_events( $demoted_author_id, $role ) { if( ('subscriber' == $role) || ('s2member_level0' == $role) && 'publish' == get_post_status( $p->ID) ) { $args = array( 'numberposts' => -1, 'author' => $demoted_author_id, 'post_type' => 'event', ); $demoted_author_posts = get_posts( $args ); foreach( $demoted_author_posts as $p ) { $my_post = array( 'ID' => $p->ID, 'post_status' => 'pending', ); wp_update_post( $my_post ); //Now do the database table update //UPDATE `database_name`.`wp_em_events` SET `event_status` = '0' WHERE `wp_em_events`.`event_id` = ID; } } }
Project ID: 11538830

About the project

23 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I'm an experienced wordpress developer and I'm familiar with Events Manager plugin as well and so I can make the required function within a few hours after you accept my bid. Regards, Tamas
$30 USD in 0 day
4.9 (220 reviews)
6.2
6.2
23 freelancers are bidding on average $39 USD for this job
User Avatar
Dear sir, I am good for Wordpress, php, mysql, html, css,....etc so i can help you finish it. Please check my profile and give me this chance. Thank you and waiting here
$35 USD in 0 day
4.9 (256 reviews)
7.0
7.0
User Avatar
Hello Sir, I am pleased to inform you that we have 8+ years experienced developers in Mysql. we can surely update single database entry. I would be happy to work with you on this project. We want to build a long term relationship with you. Let's discuss in details and start the work. Awaiting for your response. Thanks, Vijay Thakor
$35 USD in 1 day
5.0 (39 reviews)
5.6
5.6
User Avatar
Hello sir. I am a wordpress expert with more than 3 years of experience. Let's discuss more. Regards
$10 USD in 1 day
5.0 (68 reviews)
4.9
4.9
User Avatar
Hello, I have ranking in top 5000 on freelancer.com and I hope it will give you an idea about my work quality and dedication to work. You will be safe while working with me. I have dedicated in house team for WordPress, PHP, CakePHP, Bootstrap, Magento, HTML, CSS, JavaScript, Jquery, AJAX, MySQL, PHP framework, API's, PSD to HTML, SQL, JSP, ASP.NET, .NET, App Developer, App Designer, Apache, Websites Design and Development, Web Application Development, E-commerce Website Development, Marketplace Development, Web Portal Development, Custom Software and Plug-in Development, Web Applications Testing, Android Mobile App development and all other IT skills. I will provide you proper proposal and time after you send me message as I can attach any document through PMB only. Please see our portfolio https://www.freelancer.com/u/Dilipjaipur.html?page=portfolio Final price and time I can only quote once complete discussion with you, it may be less then present bidding amount and time. Thanks
$111 USD in 3 days
4.9 (10 reviews)
4.8
4.8
User Avatar
Hi, 1. do you want a single sql script (query) that update all the entries in the table wp_em_events related to a author_id? ex. UPDATE with JOIN? 2. do you want a trigger script? sql script (UPDATE)? php code? Thanks Angelo
$35 USD in 1 day
5.0 (14 reviews)
4.3
4.3
User Avatar
5 Reasons why you should hire me for your custom website and Application Development. 1. Available 24/7 upon your request 2. Delivery on-time with 100% satisfaction 3. Always think beyond boundaries and provide user friendly solution 4. Provide excellence with commitment 5. Most important, Free technical support for lifetime. If you are looking for custom website development like Intranet application, web directory, online community, online portal, online connecting consumer and vendor, you search will end here. About Me: More, over the last 3 years, I have developed a wide range of websites and apps using .Net, PHP, Web based application, Desktop based software, MS Sql and MySQL including sites for start up companies and small businesses. My core competency lies in complete end-end management of a new website development project, and I am seeking opportunities to build websites from the ground up for you or your business. While working on your project, I am taking care of Clean and neat design Daily communication to show progress Unit testing with 100% results Free lifetime support for any technical issue! Thank you
$20 USD in 6 days
4.2 (20 reviews)
4.8
4.8
User Avatar
A proposal has not yet been provided
$30 USD in 3 days
5.0 (7 reviews)
3.7
3.7
User Avatar
I am database expert having experience of 3 years.I will complete your work as per requirements and deliver it on time.
$30 USD in 1 day
4.9 (5 reviews)
2.9
2.9
User Avatar
Hello I am Software Engineer and expert in database design and development so you can consider me for this Project Thanks I will wait for your quick response
$25 USD in 1 day
2.8 (8 reviews)
3.8
3.8
User Avatar
Hi there I am talented and experienced in Mysql, can help you to update the status of a custom post type to 'pending' when the user role is changed to 'subscriber as per the mentioned requirements I AM READY TO START IMMEDIATELY Look forward to hear from you soon Regards Laxmi
$55 USD in 1 day
5.0 (1 review)
1.0
1.0
User Avatar
Hello, This is Arpita. I would like to do this task . Please come over pm and lets start the job. We have a whole lot of experience with MYSQL , SQL and Oracle Database. I am looking forward. Thanks and Regards
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Hotchkiss, United States
5.0
14
Payment method verified
Member since Jan 14, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.