Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($msg == '/setup') {
- $servername = "localhost";
- $username = "root";
- $password = "databasebot";
- $dbname = "bots";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = "CREATE TABLE chatdata (
- id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- chatid VARCHAR(30) NOT NULL,
- username VARCHAR(30) NOT NULL
- )";
- $conn->exec($sql);
- sm($chatID, "Fatto! Ho Creato La Tabella");
- }
- catch(PDOException $e){
- echo $sql . "<br>" . $e->getMessage();
- }
- $conn = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement