<?
require(dirname(__FILE__) . '/Settings.php');
$nva_db = array("db_server" => $db_server, "db_name" => $db_name, "db_user" => $db_user, "db_passwd" => $db_passwd, "db_prefix" => $db_prefix, "db_table" => "");
$nva_db['db_table'] = $nva_db['db_prefix'] . "version_notice";
$nva_dbconn = mysql_connect($nva_db['db_server'], $nva_db['db_user'], $nva_db['db_passwd']); //Подключаемся к базе данных
if (!$nva_dbconn) {die('Could not connect: ' . mysql_error()); } //Проверяем подлючение
print('<pre>'); print_r("Connected successfully | " . $nva_dbconn); print('</pre>');
$nva_dbselect = mysql_select_db($nva_db['db_name'], $nva_dbconn);
if (!$nva_dbselect) {die('Could not select database: ' . mysql_error()); } //Проверяем выбор базы данных
print('<pre>'); print_r("Database seleted | " . $nva_dbselect); print('</pre>');
$nva_select_result = mysql_query("SELECT `id_member` FROM `smf_members`", $nva_dbconn);
print('<pre>'); print_r("Select Query Result | " . $nva_select_result); print('</pre>');
if (!$nva_select_result) die(mysql_error());
while ($row = mysql_fetch_assoc($nva_select_result)) {
echo "user_id : " . $row["id_member"] . "
";
mysql_query("INSERT INTO `" . $nva_db['db_table'] . "` (`user_id`) VALUES ('" . $row["id_member"] . "')");
}
mysql_close($nva_dbconn);
?>