<?php
$user_ids = array( 1, 2, 3 ); //a list of the users you want to send the badge to
foreach ( $user_ids as $id )
{
mysql_query( "UPDATE `Users` SET `Badge` = 'badgecode' WHERE `UserID` = '" . $id . "'" );
}
?>
There is a separate table for badges called 'user_badges' the table has 2 collumns one for User ID called 'user_id' and one for badge ID 'badge_id'You have the ID's?
Well, put them in an array like this:
PHP:<?php $user_ids = array( 1, 2, 3 ); //a list of the users you want to send the badge to foreach ( $user_ids as $id ) { mysql_query( "UPDATE `Users` SET `Badge` = 'badgecode' WHERE `UserID` = '" . $id . "'" ); } ?>
I'll let you do the Phoenix db shit, I don't know how the database is structured so you'll have to replace '`Users`', '`Badge`' and '`UserID`' with whatever Phoenix uses.
<?php
$user_ids = array( 1, 2, 3 ); //a list of the users you want to send the badge to
foreach ( $user_ids as $id )
{
mysql_query( "UPDATE `user_badges` SET `badge_id` = 'badgecode' WHERE `user_id` = '" . $id . "'" );
}
?>
I'm getting:Try something like
PHP:<?php $user_ids = array( 1, 2, 3 ); //a list of the users you want to send the badge to foreach ( $user_ids as $id ) { mysql_query( "UPDATE `user_badges` SET `badge_id` = 'badgecode' WHERE `user_id` = '" . $id . "'" ); } ?>
Or something, I'm not entirely sure.
<?php
$badecode = ""; // Put the badge ID here
mysql_query( "UPDATE `user_badges` SET `badge_id` = '" . $badgecode . "' WHERE `user_id` = '" . $id <= 500 . "'" );
?>
85108, 89329, 48628, 99474, 2325, 87283, 25997, 76514, 95880, 88795, 43490, 93312, 96788, 42730, 6532, 37167, 644, 101400, 80333, 32841, 15009, 26240, 65647, 19145, 52557, 101100, 10194, 66330, 98767, 99041, 3315, 101515, 25630, 99474, 55312, 84066, 96669, 17610, 4907, 71694, 16443, 51782, 28931, 82211, 34125, 101510, 69990
<?php
$users = "85108, 89329, 48628, 99474, 2325, 87283, 25997, 76514, 95880, 88795, 43490, 93312, 96788, 42730, 6532, 37167, 644, 101400, 80333, 32841, 15009, 26240, 65647, 19145, 52557, 101100, 10194, 66330, 98767, 99041, 3315, 101515, 25630, 99474, 55312, 84066, 96669, 17610, 4907, 71694, 16443, 51782, 28931, 82211, 34125, 101510, 69990";
$usersexp = explode( ", ", $users );
foreach ( $usersexp as $id )
{
mysql_query( "UPDATE `user_badges` SET `badge_id` = 'badgecode' WHERE `user_id` = '" . $id . "'" );
}
?>
Ok so what do I do with this, run it as a query or put it as a .php file and go to it?PHP:<?php $users = "85108, 89329, 48628, 99474, 2325, 87283, 25997, 76514, 95880, 88795, 43490, 93312, 96788, 42730, 6532, 37167, 644, 101400, 80333, 32841, 15009, 26240, 65647, 19145, 52557, 101100, 10194, 66330, 98767, 99041, 3315, 101515, 25630, 99474, 55312, 84066, 96669, 17610, 4907, 71694, 16443, 51782, 28931, 82211, 34125, 101510, 69990"; $usersexp = explode( ", ", $users ); foreach ( $usersexp as $id ) { mysql_query( "UPDATE `user_badges` SET `badge_id` = 'badgecode' WHERE `user_id` = '" . $id . "'" ); } ?>
Try that.