PDA

View Full Version : Please Help! This is driving me nuts...


jarosciak
03-06-2007, 01:21 AM
I need to programmatically change the value of smtp_host in vbulletin mysql db, under datastore / options

This screenshot shows which variable/database/table I am referring to:
http://www.vbulletin.com/forum/attachment.php?attachmentid=22200&d=1173109661

It would be very simple if datastore / options, had only one value in it, but there is like 50 different variables and I need to change the value of only one of them, lets say it is variable: smtp_host

How do I do this?

This is my code, to do change the value of 'smtp_host' to 'smtp.mail.com':
<?php
require_once('./global.php');
require_once('./includes/functions_user.php');
$vbulletin->options = unserialize($vbulletin->options);
$vbulletin->options['smtp_host'] = 'smtp.mail.com';
$result = build_datastore('options', serialize($optionstmp));
?>

But, when I tried to run it, it gave me this error:
Warning: unserialize() expects parameter 1 to be string, array given in \smtp.php on line ...

Afterwards, my whole forum went haywire and I had to restore the 'datastore' table from the backup, because it was giving me this error:
Fatal error: Cannot create references to/from string offsets nor overloaded objects in: C:\..\..\includes\class_core.php on line 1283

Anyhow, any suggestion on how I can update this one field?
It'll be something simple, I bet, but I am stuck on it, the whole rest of my hack is already done...

Can someone help?

Joe :confused:

Anyone?

Could anyone please look at this?
It must be simple, but for some reason it won't work...