WordPress.org

Ready to get started?Download WordPress

Forums

UPDATE query gets truncated at certain chars (2 posts)

  1. juanjico
    Member
    Posted 1 year ago #

    Within my code, i'm trying to update some options at the table wp_options.

    The data is a complex array. But always, the serialized data is truncated at certain chars. For example, this is the last portion of data saved into the table:

    [....]5";}i:33;a:3:{i:0;s:10:"Blend N

    Note that the serialized string, is not terminated. After the 'N' there is a 'º' (Nº) char. So, for some reason, this char makes WP to truncate the generated string at this position.

    I've tried using the update_option() function, directly with an UPDATE query using $wpdb->query(), tried to clean the string with $wpdb->prepare(), using directly htmlentities() addslashes() ....

    Nothing works. The string is always truncated at this char.

    But, if I simple echo() the serialized array, then copy from the web browser and paste it on navicat, the UPDATE works perfect. o, its not a problem with the db.

    Any idea ???

    Thanks!

  2. vtxyzzy
    Member
    Posted 1 year ago #

    Try using the HTML º instead of the(º).

Topic Closed

This topic has been closed to new replies.

About this Topic