|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/academic/demo/ |
Upload File : |
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_StudentTrackerV = "mysql.web.rcn.net";
$database_StudentTrackerV = "academicassetmanagement_com";
$username_StudentTrackerV = "Admin";
$password_StudentTrackerV = "snarf16";
$StudentTrackerV = mysql_connect($hostname_StudentTrackerV, $username_StudentTrackerV, $password_StudentTrackerV) or trigger_error(mysql_error(),E_USER_ERROR); ?>
<?php if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_Recordset1 = "-1";
if (isset($_COOKIE['Teacher'])) {
$colname_Recordset1 = $_COOKIE['Teacher'];
}
mysql_select_db($database_StudentTrackerV, $StudentTrackerV);
$query_Recordset1 = sprintf("SELECT * FROM `asset tagged textbooks` WHERE `Class` = %s ORDER BY Student ASC", GetSQLValueString($colname_Recordset1, "text"));
$Recordset1 = mysql_query($query_Recordset1, $StudentTrackerV) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Class Report</title>
</head>
<body>
<p><?php echo $_COOKIE['Teacher']; ?> Student Textbook List</p>
<p> </p>
<table border="1">
<tr>
<td>Asset Tag</td>
<td>ISBN</td>
<td>Title</td>
<td>Student</td>
<td>Date Checked Out</td>
<td>Date Checked In</td>
<td>Class</td>
<td>Textbook Cost</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['Asset Tag']; ?></td>
<td><?php echo $row_Recordset1['ISBN']; ?></td>
<td><?php echo $row_Recordset1['Title']; ?></td>
<td><?php echo $row_Recordset1['Student']; ?></td>
<td><?php echo $row_Recordset1['Date Checked Out']; ?></td>
<td><?php echo $row_Recordset1['Date Checked In']; ?></td>
<td><?php echo $row_Recordset1['Class']; ?></td>
<td><?php echo $row_Recordset1['Textbook Cost']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>