Procurement and Business Services
/* declare some relevant variables */
$hostname = "192.168.2.1";
$username = "FRS"; $password = "ehHyCVf3RT2Gv8jJngNB";
$tablep1 = "fasfrs";
$tablep2 = "l";
$dbName = "FRS";
$tablename = $tablep1 . $file . $tablep2;
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
$fas = ereg_replace("-", "", $fas);
print "
FAS To FRS Lookup ";
if ($fas <> '')
{
$query1 = 'SELECT * FROM datadate where tablename="' . $tablename . '"';
$result1 = MYSQL_QUERY($query1);
$validdate = mysql_result($result1, 0, "lastimported");
print "(Data valid as of $validdate)";
}
print "
\n";
print " \n";
print '";
print " ";
if ($fas <> '')
{
#$query = "SELECT * FROM $table1 where fasno > '0' order by fasno";
$query = 'SELECT * FROM ' . $tablename . ' where fasno = "' . $fas . '"';
$result = MYSQL_QUERY($query);
/* How many of these users are there? */
$number = MYSQL_NUMROWS($result);
/* Print these results to the screen in a nice format */
$i = 0;
IF ($number == 0)
{
PRINT "
Cannot find a corresponding FRS Number for FAS Number $fas