fork download
  1. <?php
  2. try
  3. {
  4. $conn = new PDO('mysql:host=host_bazy;dbname=nazwa_bazy', 'user', 'pass');
  5. $conn->exec("CREATE TABLE `users` (`id` int NOT NULL AUTO_INCREMENT, `user` char(30), `passwd` char(70), PRIMARY KEY(`id`));");
  6. $conn->exec("INSERT INTO `users` (`id`, `user`, `passwd`) VALUES (NULL, 'admin', 'f7715d0d4a1546213ce3e9ab6fd90581b1f3a2e3c0d42d2e4a31ddeed89ad632');");
  7. echo 'Wszystko ok';
  8. } // End try
  9. catch(PDOException $e)
  10. {
  11. echo 'Błąd:'.$e->getMessage();
  12. } // End catch
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty