// 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(); ?>
Warning: Use of undefined constant laskettu - assumed 'laskettu' (this will throw an Error in a future version of PHP) in /home/okkolat/public_html/Tulostieto/laskuri.php on line 3

Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/okkolat/public_html/Tulostieto/laskuri.php:7 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 7