Skip to content

Commit

Permalink
added php snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
aetonsi committed Dec 28, 2023
1 parent c8110c9 commit d1847e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev/php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Useful notions for php developers.

- [snippets](snippets.md)
- [`php.ini` settings](php-ini.md)
- [Xdebug settings](xdebug-settings.md)
- [[ext] "Front Line PHP"](https://www.youtube.com/playlist?list=PLjzBMxW2XGTwEwWumYBaFHy1z4W32TcjU) - php8 introduction by [Spatie](https://github.com/spatie)
11 changes: 11 additions & 0 deletions dev/php/snippets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# snippets.md

## `PDO` connection to a MSSQL Server

```php
$addr = '127.0.0.1\SQLEXPRESS';
$usr = 'sa';
$pwd = readline('Enter Password: ');
$obj = new PDO("sqlsrv:Server=$addr", $usr, $pwd);
echo $obj->query('SELECT @@VERSION')->fetch(PDO::FETCH_COLUMN);
```

0 comments on commit d1847e0

Please sign in to comment.