Folder reorganize 1
This commit is contained in:
35
OLD/overviewold/tonsin.php
Normal file
35
OLD/overviewold/tonsin.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$serverName = "CBM2K12\SQLEXPRESS";
|
||||
$uid = "cbmclient";
|
||||
$pwd = "ascbm2k";
|
||||
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"SugarCaneScale" );
|
||||
|
||||
/* Connect using SQL Server Authentication. */
|
||||
$conn = sqlsrv_connect( $serverName, $connectionInfo);
|
||||
if( $conn === false )
|
||||
{
|
||||
echo "Unable to connect.</br>";
|
||||
die( print_r( sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
$sql = "SELECT ROUND (Tons,0) AS Tons FROM LoadData WHERE CropDay = ( SELECT Max(CropDay) FROM LoadData)";
|
||||
|
||||
$stmt = sqlsrv_query( $conn, $sql );
|
||||
if( $stmt === false) {
|
||||
die( print_r( sqlsrv_errors(), true) );
|
||||
}
|
||||
$tonsin = 0;
|
||||
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
|
||||
{
|
||||
$tonsin += $row['Tons'];
|
||||
|
||||
}
|
||||
|
||||
//end
|
||||
|
||||
?>
|
||||
<?php echo $tonsin; ?>
|
||||
<?
|
||||
$db = null;
|
||||
?>
|
||||
Reference in New Issue
Block a user