Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $search_conditions = array("conditions" => "name LIKE '%".$search_term."%' OR resturant_name LIKE '%".$search_term."%'");
- $res = dish_find($search_conditions);
- $res_list = dish_find($search_conditions);
- ?>
- <select>
- <?
- while ($rest = mysql_fetch_array($res_list, MYSQL_BOTH)) {
- // $list = array($rest["resturant_name"]);
- echo '<option>'.$rest["resturant_name"].'</option>';
- }
- ?>
- </select>
- <ul class='list'>
- <?
- while ($row = mysql_fetch_array($res, MYSQL_BOTH)) {
- $rating = ($row["avgTaste"] + $row["avgTexture"] + $row["avgSmell"] + $row["avgSize"] + $row["avgPresentation"]) / 5;
- ?>
- <li id="<? echo $row["resturant_name"] ?>">
- <a href="dish.php?id=<? echo $row["id"] ?>">
- <span class="photo">
- <? if(file_exists("../userImages/".$row['thumb']) && $row['thumb'] != "") {?>
- <img src="../userImages/<? echo $row["thumb"] ?>" alt=""/>
- <? } else { ?>
- <img src="images/missing_dish_image.jpeg" alt=""/>
- <? } ?>
- </span>
- <strong class="dish">Dish: <em><? echo $row["name"] ?></em></strong>
- <span class="inf">Restaurant: <em><? echo $row["resturant_name"] ?></em></span>
- <span class="inf">Twiddish Rating: <em><? echo $rating ?></em></span>
- </a>
- </li>
- <?
- }
- if(mysql_affected_rows() == 0){
- echo "<h2>We couldn't find what you were looking for please try again.</h2>";
- }
- //printf("Results: %d\n", mysql_affected_rows());
- ?>
- </ul>
Add Comment
Please, Sign In to add comment