i'm having issues printing additional data taken from my database.
The code as it is:
<?php
include 'connect.php';
error_reporting(0);
if(isset($_POST['search'])) {
$searchquery = $_POST['search'];
$searchquery = preg_replace("#[^0-9a-z]#i","",$searchquery);
$query = mysql_query("SELECT * FROM tbl_venues WHERE venue_name LIKE '%$searchquery%' OR venue_adress LIKE '%$searchquery%'") or die("Search failed!");
$count = mysql_num_rows($query);
if($count == 0){
$output = 'No results found!';
}else{
while($row = mysql_fetch_array($query))
{
$vname = $row['venue_name'];
$vadress = $row['venue_adress'];
$id = $row['venue_id'];
$type = $row['venue_type'];
$output .= sprintf('<div id="searched"><a href="venue.php?venue=%d">%s</a></div>',
$row['venue_id'],$vname);
}
}
}
?>
I have the venue_name or $vname being output and linked but would like $vadress and others as well. It must be done on the output line and i would like to show more than the $vname that is already showing example:
$output .= sprintf('<div id="searched"><a href="venue.php?venue=%d">%s</a></div>',
$row['venue_id'],$vname, $vadress, $type);
The above doesn't work
Can anyone help, Thanks