Files
2026-10-19 15:22:52 -07:00

48 lines
1.2 KiB
PHP

<?php
include "db.php";
$databases = array(
'hotlunch_20210427',
'hotlunch_20210628',
'hotlunch_20210701',
'hotlunch_20210922',
'hotlunch_20220430',
'hotlunch_20220714',
'hotlunch_20221007',
'hotlunch_20230424',
'hotlunch_20230624',
'hotlunch_20230704',
// 'hotlunch_20240824',
// 'hotlunch_20240825',
// 'hotlunch_20240826',
// 'hotlunch_20240827',
// 'hotlunch_20240828',
);
$Schools = array();
$query = "SELECT school_name, url, record_num FROM schools";
$results = db_query($query);
while ($row = db_fetch_assoc($results)) {
$Schools[] = $row;
}
for ($i = 0; $i < count($databases); $i++) {
$db = $databases[$i];
echo("$db\n");
db_query("USE $db");
for ($n = 0; $n < count($Schools); $n++) {
$school = $Schools[$n];
extract($school);
$query = "UPDATE schools SET url = '$url' WHERE record_num = $record_num";
db_query($query);
}
}
?>