use stored procedure in WordPress
-
Hi there,
I really would like to perform a stored procedure in MySQL which updates the wp_bp_xprofile_data table with information from a view in MySQL. The procedure should be started when somebody updates his profile. This is the code I use in bp-custom.php.function something_updated_profile() { $wpdb->query("CALL dekking_ophalen( )"); } add_action('xprofile_updated_profile', 'something_updated_profile');
However, when I update my profile I only see a white page ( I have debugger enabled). After doing some research on the buddypress forums I am pretty sure that the error I make is in the $wpdb->query(“CALL dekking_ophalen( )”); line. I use wordpress 3.9.1 & bp 2.0.1. The stored procedure is stated as:
INSERT INTO wp_bp_xprofile_data ( field_id, user_id, value ) SELECT 15, User, dekking_absoluut FROM dekking On duplicate KEY UPDATE wp_bp_xprofile_data.value=(SELECT dekking.dekking_absoluut FROM dekking WHERE dekking.user=wp_bp_xprofile_data.user_id )
This stored procedure doesn’t need to give any results, it just have to perform an update on a table. What point am I missing here?
- The topic ‘use stored procedure in WordPress’ is closed to new replies.