outputing additional sql result data with php -
i'm having issues printing additional data taken database.
the code 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 * tbl_venues venue_name '%$searchquery%' or venue_adress '%$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 venue_name or $vname being output , linked $vadress , others well. must done on output line , show more $vname 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 help, thanks
Comments
Post a Comment