Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <style>
- table, th, td {
- border: 1px solid black;
- border-collapse: collapse;
- text-align:left;
- }
- </style>
- </head>
- <body>
- <table>
- <tbody>
- <?php
- $user = 'std-43';
- $password = 'dssp4141';
- $link = sqlsrv_connect('172.20.180.239', array( "Database"=>"pubs", "UID"=>$user, "PWD"=>$password, "CharacterSet" => "UTF-8" ));
- if ($link === false){
- die( print_r( sqlsrv_errors(), true));
- }
- $stmt = sqlsrv_query($link, 'SELECT title, price FROM titles');
- while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){
- echo '<tr><td>' . $row['title'] . '</td><td>' . $row['price'] . '</td></tr>';
- }
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement