Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "scse";
- $password = "scse";
- //Create connection
- $conn = mysqli_connect($servername, $username, $password);
- // Check connection
- if(!$conn)
- {
- die("Connection failed: " . mysqli_connect_error());
- }
- if(!mysqli_select_db($conn, "scse"))
- {
- echo "Database not selected";
- }
- // sql to create table
- $sql = "CREATE TABLE register (
- id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- Name VARCHAR(30) NOT NULL,
- Email VARCHAR(50) NOT NULL,
- Website VARCHAR(50) NOT NULL,
- Message VARCHAR(50)
- )";
- if (mysqli_query($conn, $sql)) {
- echo "Table register created successfully";
- } else {
- echo "Error creating table: " . mysqli_error($conn);
- }
- ?>
Add Comment
Please, Sign In to add comment