Skip to content

Commit

Permalink
Start to create district functionality
Browse files Browse the repository at this point in the history
Toward #349.
  • Loading branch information
waldoj committed Jan 11, 2020
1 parent 6647a22 commit 6789cb4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions htdocs/includes/class.District.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

class District
{
public function info($chamber, $number)
{

$database = new Database;
$database->connect_mysqli();

$sql = 'SELECT id, chamber, number, description, notes
FROM districts
WHERE
date_ended = "0000-00-00"
AND chamber=' . mysqli_real_escape_string($GLOBALS['db'], $chamber) . '
AND number=' . mysqli_real_escape_string($GLOBALS['db'], $number);

$result = mysqli_query($GLOBALS['db'], $sql);
if (mysqli_num_rows($result) == 0)
{
return FALSE;
}
$district = mysqli_fetch_assoc($result);

# Clean it up.
$district = array_map('stripslashes', $district);

return $district;

}

}

0 comments on commit 6789cb4

Please sign in to comment.