Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "root";
- $dbname = "database";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $id=$_GET['id'];
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);}
- $sql = "SELECT DAY(ADDDATE(`dateC`, `durationC`)) AS month,DAY(ADDDATE(ADDDATE(`dateC`, `durationC`),`durationR`))AS days FROM normaltb where id = '$id'");
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- echo $row["month"]. "<br>";
- echo $row["days"]. "<br>";
- }
- }
- else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement