Quote:
Originally Posted by Attilitus
No. Unfortunately I do not believe vbulletin's database class supports the fetching of objects. I had to manually convert my entire object driven script to use arrays...
If anyone discovers a function in the database class... let me know but after the time I spent converting I won't be very pleased. -_-
|
Here is a piece of a script I made that fetches an object
PHP Code:
$query = $vbulletin->db->query_read("SELECT userid, username, password, email, joindate, timezoneoffset FROM user");
while ($row = mysql_fetch_object($query))
{
$row->timezoneoffset = intval($row->timezoneoffset) * 3600;
$insert = "INSERT INTO `users` (`uid`, `name`, `pass`, `mail`, `mode`, `sort`, `threshold`, `theme`, `signature`, `created`, `access`, `login`, `status`, `timezone`, `language`, `picture`, `init`, `data`) VALUES ("."'".$row->userid."',"."'".$row->username."', "."'".$row->password."', "."'".$row->email."', '0', '0', '0', '', '', "."'".$row->joindate."', '0', '0', '1', "."'".$row->timezoneoffset."', '', '', "."'".$row->email."', 'a:0:{}');";
if(!$connector->query($insert))
{
echo mysql_error();
exit();
}
}