Thank you very much devinemke 🙂 So I have replaced "table" with the table name, but I'm just wondering about field
Should I just put the name of the field, and it will change the value?
Here is my current code:
<?php
$dbhost = 'localhost'; // Server address of your MySQL Server
$dbuser = 'mackenzi_jackson'; // Username to access MySQL database
$dbpass = '*********'; // Password to access MySQL database
$dbname = 'mackenzi_inv'; // Database Name
$sqlConn = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Unable to connect!");
mysql_select_db($dbname) or die ("Unable to open database!");
$num = rand(15, 30);
$array = range(3, 839);
$rand_keys = array_rand($array, $num);
foreach ($rand_keys as $value) {$rand_values[] = $array[$value];}
$sql = "INSERT INTO phpbb_config SET allowed_users = '" . implode(',', $rand_values) . "'";
echo $sql; // just for testing
?>
When I run the script, the output comes out fine:
INSERT INTO phpbb_config SET fake_online_users = '3,26,71,96,143,154,168,181,451,636,692,699,703,731,747,779'
(or whatever numbers it outputs)
But when I go check the tables, nothing has changed...
If this helps, when I go to the field to edit it manually through phpMyAdmin, and have it output the SQL command that I processed, it gives me this:
UPDATE `phpbb_config` SET `config_value` = '823,825,834,848,484,493,809,796,815' WHERE `config_name` = 'allowed_users' LIMIT 1 ;
and in PHP mode, it gives me this:
$sql = 'UPDATE `phpbb_config` SET `config_value` = \'823,825,834,848,484,493,809,796,815\' WHERE `config_name` = \'allowed_users\' LIMIT 1;';
Thanks again