I am trying to update a custom meta variable using the update_post_meta function. I have the following code written.
update_post_meta(1054, 'freeimage_filename', $freebackgrounds->background[$i]->imagefilename);
Everytime I run this, the data is deleted and the page no longer shows the variable.
I have checked that the variable has a value and echo it in the line prior and it has a valid string.
Any ideas why the new value is not replacing the existing value and why the existing value is deleted?