// Create connection
$conn = new mysqli($localhost, $okkolat, $sukkis_5842_1959, $okkolat_jari);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// sql to create table
$sql = "CREATE TABLE MyGuests (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)";
if ($conn->query($sql) === TRUE) {
echo "Table MyGuests created successfully";
} else {
echo "Error creating table: " . $conn->error;
}
$conn->close();
?>
Fatal error: Uncaught Error: Undefined constant "laskettu" in /home/okkolat/public_html/Tulostieto/laskuri.php:3
Stack trace:
#0 /home/okkolat/public_html/Tulostieto/index.php(4): include()
#1 {main}
thrown in /home/okkolat/public_html/Tulostieto/laskuri.php on line 3