The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Product Install Code - Adding a row for each row in user
Upon product install I need to add a row to a mysql table for each row that is in the table 'user'. How would I do this bring the userid and username intot he new table? I think it's something like this:
Code:
$vbuser =& $vbulletin->userinfo; foreach ($vbuser AS $userid => $userid, $username => $username,) { $db->query_write("INSERT INTO " . TABLE_PREFIX . "banners ( userid, username, title, url, link, ext, width, height, clicks, available, impressions, status ) VALUES ( '$userid', '$username', '', '', '', '', '', '', 0, '{$vbulletin->options['banner_impressions_join']}', 0, '' )"); } |
#2
|
||||
|
||||
Untested, but should work (if I havn't added a typo or smth.)
PHP Code:
|
#3
|
|||
|
|||
Ahh, suprised I didn't think of that for the query, but will that add a row every user in the table 'user' when the product is installed? What if there is 300 users in the table? it looks like this will only add 1 row.
|
#4
|
||||
|
||||
It should add rows for all users.
|
#5
|
|||
|
|||
Thank you it did work.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|