Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pessoa:
- id_pessoa int(11) NOT NULL AUTO_INCREMENT,
- ds_pessoa varchar(20) DEFAULT NULL,
- agenda:
- id_agenda int(11) NOT NULL AUTO_INCREMENT,
- hr_agendamento time(11) DEFAULT NULL,
- id_pessoa int(11) DEFAULT NULL,
- <?php
- $hr_agendamento = $_POST['hr_agendamento'];
- $id_pessoa = $_POST['id_pessoa'];
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "test";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "INSERT INTO agenda (hr_agendamento, id_pessoa)
- VALUES ( $hr_agendamento, $id_pessoa)";
- if ($conn->query($sql) === TRUE) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement