After around 20 years of not working with PHP\MySQL, it appears I am in need of a little assistance (as I have forgotten most of what I knew) to point me in the proper direction.
What I have is a basic search field that automatically pulls information from MySQL once the user enters a couple of letters in the field. The data is quiered against certain colums in the database table (in this case it pulls from the name, street and city). For instance if a user enters "bad" it displays 2 venues that have "bad" in the name and echos the pertinent information below the search field. When the user adds an additional "a" at the end of "bad" one of the venues goes away leaving only 1 behind. The echoed information has hyperlinked venue names which leads me into what I need it to do (and where I am stumped).
What I require is when a user clicks on the hyper-linked venue name, the data for that venue is displayed in a new page. The data fields would be: name, address, city, website, email, info, event, categories and their logo (which is stored in the database as a BLOB). Yes, I know that it's quicker to reference to the logo file in the database and keep the image as a file in a directory, but that's not how the person wants it done not to mention the logo files are quite small (~60k each).
Below is the search code with the data ID echoing back for my own reference until it is no longer required to echo back. What I do know is the information will need to be placed into arrays and then read from the arrays utilizing the DB table ID. Which is where I find myself running in circles for such a basic (and archaeic) task.
<?php
include_once ('mdbconn.php');
if(isset($_GET['keyword'])){
$keyword = trim($_GET['keyword']) ;
$keyword = mysqli_real_escape_string($dbc, $keyword);
$query = "select id,venue,category,city,address,info,event from buffnoa where venue like '%$keyword%' or category like '%$keyword%' or address like '%$keyword%' or city like '%$keyword%'";
//echo $query;
$result = mysqli_query($dbc,$query);
if($result){
if(mysqli_affected_rows($dbc)!=0){
while($r = mysqli_fetch_array($result,MYSQLI_ASSOC)){
echo '<p>' .$r['id'].' <b><a href>'.$r['venue'].'</a></b> '.$r['address'].' </br>'.$r['city'].'</p>' ;
}
}else {
echo 'No Results for :"'.$_GET['keyword'].'"';
}
}
}else {
echo 'Parameter Missing';
}
?>