Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Test</title>
  5. </head>
  6. <body>
  7. <table border="5" bgcolor="white" width="300" align="center">
  8. <tr>
  9. <th bgcolor="grey">InputType</th>
  10. <th bgcolor="">Valid</th>
  11. </tr>
  12. <?php
  13. $myServer = "localhost";
  14. $myUser = "xxxxx";
  15. $myPass = "xxxx";
  16. $myDB = "xxxxxxxxx";
  17. //Connection to the database
  18. $dbhandle = mssql_connect($myServer, $myUser, $myPass)
  19. or die("Couldn't connect to SQL Server on $myServer");
  20. //Select a database to work with
  21. $selected = mssql_select_db($myDB, $dbhandle)
  22. or die("Couldn't open database $myDB");
  23. //Declare the SQL statement that will query the database
  24. $query = "SELECT inputtype, valid FROM dbo.eqinputs";
  25. //Execute the SQL query and return records
  26. $result = mssql_query($query)
  27. or die('A error occured: ' . mysql_error());
  28. //Show result
  29. while ( $rows = mssql_fetch_array($result) )
  30. {
  31. $InputType=$rows['InputType'];
  32. $Valid=$rows['Valid'];
  33. echo "<tr>
  34. <td>$InputType</td>
  35. <td>$Valid</td>
  36. </tr>";
  37. }
  38. ?>
  39. </table>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement