Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT COUNT(*) FROM my_table;
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <div class="container">
- <h5>/*mysql query result goes here*/</h5>
- </div>
- </body>
- </html>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "root";
- $dbname = "myDB";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT SUM(count) AS Count FROM my_table";
- $result = $conn->query($sql);
- $row = $result->fetch_assoc();
- echo $row['Count'];
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement