Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require 'get_yards.php';?>
- <?php
- include "/resources/library/get_yards2.php";
- ?>
- <?php
- require_once(__DIR__.'/../config.php');
- // Get the DB connection settings
- $dbHost = $config["db"]["server"]["host"];
- $dbUser = $config["db"]["server"]["username"];
- $dbPass = $config["db"]["server"]["password"];
- $dbName = $config["db"]["server"]["dbname"];
- $connectionInfo = array( "Database"=>$dbName, "UID"=>$dbUser, "PWD"=>$dbPass);
- $conn = sqlsrv_connect( $dbHost, $connectionInfo);
- if( $conn === false ) {
- die( print_r( sqlsrv_errors(), true));
- }
- $query = "SELECT YardId,Yard FROM YWBYard";
- $params = array();
- $options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
- $result = sqlsrv_query($conn, $query);
- if( $result === false){
- if( ($errors = sqlsrv_errors() ) != null) {
- foreach( $errors as $error ) {
- echo "SQLSTATE: ".$error[ 'SQLSTATE']."<br />";
- echo "code: ".$error[ 'code']."<br />";
- echo "message: ".$error[ 'message']."<br />";
- }
- }
- }
- else {
- $numRows = sqlsrv_num_rows($result);
- while($row = sqlsrv_fetch_array($result))
- {
- if($row['YardId']===1){
- echo "<li>"."<a href="."http://shunterweb/".">".$row['Yard'],"</a></li>";
- }
- elseif($row['YardId']===2){
- echo "<li>"."<a href="."http://shunterweb/bicker.php".">".$row['Yard'],"</a></li>";
- }
- else{
- echo "<li>"."<a href="."http://shunterweb/crick.php".">".$row['Yard'],"</a></li>";
- }
- }
- }
- sqlsrv_free_stmt($result);
- sqlsrv_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement