PDA

View Full Version : How can I replace the variable in datastore?


jarosciak
03-06-2007, 03:07 PM
I need to replace one of the variables in datastore / options.
Can someone provide a simple php code on how to unserialize, change the value and serialize it back?
Thank you.
Joe

I tried this code to change the options['smtp_user'] value.
It shows it was replaced, but it must be cached, because when I look at the database, there is still an old value present.
Any ideas?

<?php
require_once('./global.php');
require_once('./includes/functions_user.php');
$user = $vbulletin->options['smtp_user'];
echo $user;
echo "<br>";
$vbulletin->options['smtp_user'] = 'email@email.com';
$user2 = $vbulletin->options['smtp_user'];
echo $user2;
echo "<br>Test Done!<br>";
?>