get_user_meta and umeta_id

You can fix this in 1 of 2 ways: change the call to add_user_meta() to update_user_meta() when your 1st conditional evals to true. As explained in update_user_meta(), “If the meta field for the user does not exist, it will be added.” pass true as the $unique (4th) param to add_user_meta(). As explained in add_user_meta(), the … Read more

Add row to SQL array

What about something like this ? $custom_row = array(array(‘race_id’ => ‘1’, ‘race_name’ => ‘2’, ‘race_date’ => ‘3’)); $races = $wpdb->get_results(” select r.race_name ,r.race_id ,date_format(r.race_date,’%c.%d.%Y’) race_date from race_calendar r order by r.race_date; “, ARRAY_N); $merged_arr = array_merge($custom_row, $races); foreach ( $merged_arr as $race ) { echo $race[‘race_id’] . ‘,’ . $race[‘race_name’] . ‘,’ . $race[‘race_date’]; } … Read more