First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
include "db.php";
|
||||
include "table.php";
|
||||
|
||||
$school_num = 352;
|
||||
|
||||
db_query("USE hotlunch_2014");
|
||||
|
||||
$query = "SELECT * FROM users WHERE school_num = $school_num AND type = 'Parent'";
|
||||
$results = db_query($query);
|
||||
|
||||
$users = array();
|
||||
while ($row = db_fetch_assoc($results)) {
|
||||
$users[] = $row;
|
||||
}
|
||||
|
||||
echo("Users: " . count($users) . "\n");
|
||||
|
||||
|
||||
$query = "SELECT * FROM people WHERE school_num = $base_school_num AND people_type = 'Student'";
|
||||
$results = db_query($query);
|
||||
|
||||
$students = array();
|
||||
while ($row = db_fetch_assoc($results)) {
|
||||
$students[] = $row;
|
||||
}
|
||||
|
||||
echo("Students: " . count($students) . "\n");
|
||||
|
||||
|
||||
db_query("USE hotlunch");
|
||||
$utable = new Table("users");
|
||||
$stable = new Table("people");
|
||||
|
||||
for ($i = 0; $i < count($users); $i++) {
|
||||
$row = $users[$i];
|
||||
$query = $utable->BuildInsert($row,'Yes');
|
||||
db_query($query);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($students); $i++) {
|
||||
$row = $students[$i];
|
||||
$query = $stable->BuildInsert($row,'Yes');
|
||||
db_query($query);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user