WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is killing me - I keep getting magical array elements added to my updated array in WP.

For example if my query is (var_dumped below):

string(70) "UPDATE wp_mytable SET already_played = '[9]' WHERE user_id = '1'

the already_played cell shows:


what the hell is going on? Like i say, I var_dump the query and I'm positive its only running once... am I missing something very obvious here? Its set as MEDIUMTEXT.

EDIT here is the code:

global $wpdb;
$my_table = $wpdb->get_blog_prefix() . "mytable";   
$newQuery = "UPDATE " . $my_table . " SET already_played = '$allPlays' WHERE user_id = '$userID'";
$someResult = $wpdb->query($newQuery);

//RESULT is not just 5 and 6, but 5,6,and other randoms!!
share|improve this question
What code are you using to generate and commit this query? As is, that update statement (if put directly in through phpMyAdmin) would not give you that output ... so we need some more context regarding how you're building the query and sending it through WP. – EAMann Jul 13 '12 at 16:45
edited and added code. – dama_do_bling Jul 13 '12 at 16:58
@dama_do_bling What does $allPlays echo right before it's put into the database? – fdsa Jul 13 '12 at 22:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.