View difference between Paste ID: JjeSxtBd and WdsuYmFm
SHOW: | | - or go back to the newest paste.
1
<?php
2
try {
3
        $dbh = new PDO('mysql:host=localhost;dbname=saurabh','root',"");
4
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
5
        foreach($dbh->query('SELECT * FROM emp WHERE id = 2') as $row) {
6
        print_r($row);
7
    }
8
    $dbh = null;
9
} catch (PDOException $e) {
10
        print "Error!: " . $e->getMessage() . "</br>";
11
        die();
12
}
13-
echo $_GET['id'];
13+
echo $_GET['id'].'foo';