PDA

View Full Version : Some help


t x1
06-20-2008, 11:28 PM
Hello,

Well i made this code for a punbb site for my game


$db->query('INSERT INTO '.$db->prefix.'curstats(`user`) VALUES(\''.$db->escape($username_hash).'\')') or error('Unable to fill curstats', __FILE__, __LINE__, $db->error());
$db->query('INSERT INTO '.$db->prefix'.experience(`user`) VALUES(\''.$db->escape($username_hash).'\')') or error('Unable to fill experience', __FILE__, __LINE__, $db->error());
$db->query('INSERT INTO '.$db->prefix.'players(`user`, `username`, `owner`, `pass`, `creation_date`, `creation_ip`) VALUES(\''.$db->escape($username_hash).'\', \''.$db->escape($username).'\', \''.intval($pun_user['id']).'\', \''.md5($password1).'\', \''.time().'\', \''.get_remote_address().'\')') or error('Unable to fill players', __FILE__, __LINE__, $db->error());
$db->query('INSERT INTO '.$db->prefix."invitems(`user`, `id`, `amount`, `wielded`, `slot`) VALUES
('".$db->escape($username_hash)."', '376', '1', '0', '0'),
('".$db->escape($username_hash)."', '87', '1', '0', '1'),
('".$db->escape($username_hash)."', '166', '1', '0', '2'),
('".$db->escape($username_hash)."', '156', '1', '0', '3'),
('".$db->escape($username_hash)."', '168', '1', '0', '4'),
('".$db->escape($username_hash)."', '13', '1', '0', '5'),
('".$db->escape($username_hash)."', '70', '1', '0', '6'),
('".$db->escape($username_hash)."', '4', '1', '0', '7'),
('".$db->escape($username_hash)."', '1263', '1', '0', '8')
") or error('Unable to fill curstats', __FILE__, __LINE__, $db->error());

But every time iam adding it and then registing that account i get
Fatal error: Call to undefined method vB_DataManager_User::query() in C:\wamp\www\Vb\register.php on line 288
Anyone got a idea?

Dismounted
06-21-2008, 03:33 AM
Where are you adding it?

t x1
06-21-2008, 08:28 AM
Register.php under
$userdata->set_info('coppauser', $vbulletin->GPC['coppauser']);
$userdata->set_info('coppapassword', $vbulletin->GPC['password']);
$userdata->set_bitfield('options', 'coppauser', $vbulletin->GPC['coppauser']);
$userdata->set('parentemail', $vbulletin->GPC['parentemail']);

Dismounted
06-21-2008, 09:07 AM
You should use plugins to insert your snippets of code, furthermore, please read up on the vBulletin Database Class.

Using the vBulletin Database Class (https://vborg.vbsupport.ru/showthread.php?t=119350)