1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $dsn = "mysql:dbname=sier;host=namysql.database.windows.net" ; $user = "hoge@namysql" ; $password = "hogehoge" ; try { $dbh = new PDO( $dsn , $user , $password ); } catch (PDOException $e ){ print ( 'connection failed:' . $e ->getMessage()); } $sql = "select * from forein" ; $stmt = $dbh ->query( $sql ); $result = $stmt ->fetchAll(PDO::FETCH_ASSOC); print_r( '<pre>' ); var_dump( $result ); print_r( '</pre>' ); |
ぎゃーーー!
って別に驚くことではないが。。