Display record after search

I got a simple form in html thats only a search form for searching metadata from a database:

[code]

Search
[/code]

[php]<?php
mysql_connect(“localhost”, “root”, “”) or die(mysql_error());
mysql_select_db(“saeri”) or die(mysql_error());
if(isset($_POST[‘submit’]))
{
$query = $_POST[‘query’];
?>

<?php echo $query;?> <?php $min_length = 1; if(strlen($query) >= $min_length) { $query = htmlspecialchars($query); $query = mysql_real_escape_string($query); echo ""; echo ""; $raw_results =

mysql_query(“SELECT * FROM metadata WHERE (Keyword LIKE '%”.$query."%’) OR (Title LIKE ‘%".$query."%’)");
if(mysql_num_rows($raw_results) > 0)
{
while($results = mysql_fetch_array($raw_results))
{
echo "

" ; }

}
else{
echo "

"; echo "
Title Author
".$results['Keyword']." ".$results['Title']." ".$results['Language']."
No results
"; } } else{ echo "Minimum length is ".$min_length; }}

?>

[/php]

So what im looking for is that once the records are displayed I have the chance to click on a title and then query the database again for that especific record, thus allowing me to ‘go to another page’ where all the fields in the database for that especific record are displayed.

I have an example right here:
First you see the simple search form:

http://portal.oceannet.org/search/full

Then you search for whatever. eg: ‘whale’

http://portal.oceannet.org/search/full/catalogue?q=whale&sd=&ed=&t=co&a=&Graticule=Graticule&bbox=

en it returns a list of records and each one has a link, one you clic on the link you get the whole info for that record.

http://portal.oceannet.org/search/full/catalogue/ukho.ac.uk__MEDIN_2.3__23dccbbe-4253-3c1f-b9ee-74f788f97d20.xml

Hope I explain myself well… hehe

Thanks in advance.

Sponsor our Newsletter | Privacy Policy | Terms of Service