PDA

View Full Version : Write Some Settings


Pc 1203
08-03-2007, 01:02 AM
Hi,
I'm wondering, is there a vBulletin function that will allow me to write something to a database in vBulletin?

- Pc1203

Kirk Y
08-03-2007, 01:27 AM
What exactly are you trying to write?

Pc 1203
08-03-2007, 01:28 AM
I'm trying to write what user profile template the user wants. It will be in an external page, not the UserCP.

- Pc1203

Kirk Y
08-03-2007, 01:33 AM
Well the vBulletin database is no different than any other. You can use an insert/update query to add rows or tables.

$db->query("UPDATE " . TABLE_PREFIX . "table SET row = var");

Pc 1203
08-03-2007, 01:41 AM
Ok, thanks!

- Pc1203

EDIT: Where would I put the information I want to update? EX: Can you tell me how to update this:

vB_userfield, field7

Kirk Y
08-03-2007, 01:54 AM
If you want to update a profile field, try the following:
$vbulletin->db->query("UPDATE userfield SET fieldX ='" . $data . "' WHERE userid =".$userid);

Pc 1203
08-03-2007, 01:58 AM
Ok, thanks a bunch! You're a great helper!

- Pc1203