Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <title>testing pdo</title>
- <body>
- <?php
- /*
- $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- $db->prepare('select * from trying;');
- $sqlite="sqlite:test.sqlite";
- try {
- $pdo = new PDO($sqlite);
- } catch(PDOException $e) {
- die ('Connection to ' . $database . ' failed.');
- }
- $sql = "select * from trying;";
- $search = $pdo->prepare($sql);
- $search->execute();
- echo $db;
- */
- /* echo exec('`which mysql_config` --socket'); */
- /* mysql version -- not working.*/
- $dbname = 'x';
- $user = 'x';
- $pass = 'x';
- $server = 'x';
- try {
- # MySQL with PDO_MYSQL
- $DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
- }
- catch(PDOException $e) {
- echo 'Oops ' . $e->getMessage();
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment