Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $conn = mysql_connect('localhost','root','') or die('Wrong username or password; cant connect');
- $db_select = mysql_select_db('bincomphptest', $conn) or die('cant find database');
- $sql = "SELECT party_abbreviation, SUM(party_score) FROM announced_lga_results GROUP BY party_abbreviation";
- $query = mysql_query($sql) or die ('cant run query');
- $data = "mysql_fetch_assoc($query)";
- ?>
- <html>
- <head><title> RESULTS </title></head>
- <body>
- <h1><font color='blue'>This page displays the summed total result </font></h1>
- <h3><strong>Status:</strong></h3>Query was successful.
- <br>
- <br>
- <select name="sl1">
- <?php
- do {
- ?>
- <option value="">
- <?php echo "Total:" .$data['party_abbreviation']. " = " .$data['SUM(party_score)']; ?>
- </option>
- <?php
- } while($data = mysql_fetch_assoc($query));
- ?>
- </select>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment