UNIVERSITY of GLASGOW

Centre for Business History in Scotland

Library

Welcome to the Centre for Business History in Scotland's Library page. Below you will find a search engine for the library.

Please type in your query below selecting 'Search in' and the 'Sort' order.
NB. Use the format "Surname, Initial" to perform an Author search.


Unable to connect to the server at this time

'); } // Connect to the database. if(!@mysql_select_db("$dbname")) { exit ('

Unable to connect to the halt bar database at this time

'); } $result1 = @mysql_query('SELECT * FROM librarytext'); if(!$result1) { exit ('

Error performing query ' . mysql_error() . '

'); } ?>
  

Please enter a search...

"; exit; } // check for a search parameter if (!isset($var)) { echo "

We dont seem to have a search parameter!

"; exit; } $query = "select * from $table where $col like \"%$trimmed%\" order by $sorted"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); // If we have no results, offer a google search as an alternative echo "search results for \"".$trimmed."\" in ".$col.""; if ($numrows == 0) { echo "

Results

"; echo "

Sorry, your search: \"" . $trimmed . "\" returned no results. Please check your query.

"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); // display what the person searched for echo "

You searched for: \"" . $var . "\"

"; //Show Count and Pages $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "

Showing results $b to $a of $numrows

"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " << Prev ".$limit." "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (! ((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo "Next ".$limit." >>"; } // begin to show results set echo "

Results:


"; $count = 1 + $s ; /* This its the header, be sure you update this to match your columns in your MySQL table */ //echo ""; // Original Layout //echo " // // // // // // // // //\n" ; /* Be sure you update this to match your columns in your MySQL table */ while ($row= mysql_fetch_array($result)) { $col_1 = $row['4']; $col_2 = $row['5']; $col_3 = $row['6']; $col_4 = $row['7']; $col_5 = $row['3']; $col_6 = $row['8']; $col_7 = $row['2']; echo '
no.
Author
Title
Publisher
Date
Subject
Pages
Congress ID
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '

' . $count. '

Author:' . $col_1 . '
Title:' . $col_2 . '
Publisher:' . $col_3 . '
Date:' . $col_4 . '
Subject:' . $col_5 . '
Pages:' . $col_6 . '
Congress ID:' . $col_7 . '
'; echo '
'; echo '
'; /* End edit */ echo "\n"; $count++ ; } echo ""; $currPage = (($s/$limit) + 1); //break before paging echo "
"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " << Prev ".$limit." "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (! ((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo "Next ".$limit." >>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "

Showing results $b to $a of $numrows

"; ?>