Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test
- <table>
- <?php
- $servername = "WIN-TM6CLH242T3\SQLEXPRESS";
- $uid = "direktor";
- $pwd = '123+"*';
- $dbname = "DB-Schule";
- $connectioninfo = array("Database" => $dbname, "UID" => $uid, "PWD" => $pwd);
- // Create connection
- $conn = sqlsrv_connect($servername, $connectioninfo);
- if ($conn){
- $sql = "SELECT IAM, Vorname FROM dbo.tblStudent";
- $stmt = sqlsrv_query( $conn, $sql );
- if( $stmt === false) {
- die( print_r( sqlsrv_errors(), true) );
- }
- while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
- echo $row['IAM'].", ".$row['Name']."<br />";
- foreach ($row as $key => $value) {
- echo $key.", ".$value."<br>";
- }
- }
- sqlsrv_free_stmt( $stmt);
- }else{
- die(print_r(sqlsrv_errors(), true));
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement