So I have table which is acting as a search facility using a FULLTEXT approach.
Im getting results but there is one adjustment I would like to make which is bothering me.
Basically my table design is:
qualityadminid
qualityname
etc
etc
search_section
search_title
search_url
The search results echo the last three fields: here is my code so far:
<?php
include("connect.php");
$search = $_POST['search'];
$sql= "SELECT * FROM qualityadmin WHERE MATCH (quality_name, local_agency, contact, what_is_it, who_what_apply, how_work, resource_implications, how_meet_standards, widespread, pros_cons, benefits) AGAINST ('" . stripslashes (str_replace (""", "\"", ($_POST['search']))) . "' IN BOOLEAN MODE)";
$result = mysql_query($sql, $connection) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
// begin output here:
echo '<style type="text/css">
#myTable td {
font-family:arial, helvetica, sans-serif;
font-size: 14px;
}
.heading {
background:#eee;
color: #0000cc;
}
</style>
<table cellpadding="2" cellspacing="0" border="1" id="myTable" width="700px">
<tr>
<td class="heading" colspan="3">Result</td>
</tr>
<tr>
<td colspan="3">' . $row['search_title'] .'</td>
</tr>
<tr>
<td colspan="3">' . $row['search_section'] .'</td>
</tr>
<tr>
<td colspan="3">' . $row['search_url'] .'</td>
</tr>
</table>';
}
}
?>
Have a look for yourself to see how this operates at present- type in 'ACRE' for e.g.
www.mindseyemidlands.co.uk/notts_quality/info_resource/search.php
I would like to echo search_section and search title but I would like it so clicking search_title would result in navigating to it's search_url. Does this make sense?