bis_codex Posted February 9, 2022 Share Posted February 9, 2022 I created a database with the name 'food-order', on the search bar i can only search for files on one of the table, how can i search for all the items within the database 'food-order' not a specific table <?php //sql query to get category based on search keyword $sql = "SELECT * FROM tl_category AND apartment_rent WHERE title LIKE '%$search%' OR description LIKE '%$search%' OR location LIKE '%$search%'"; // execute the query $res = mysqli_query($conn, $sql); // count rows $count = mysqli_num_rows($res); // check whether category is available or not if($count>0){ // category is available while($row=mysqli_fetch_assoc($res)){ // get the details $id = $row['id']; $title = $row['title']; $price = $row['price']; $description = $row['description']; $location = $row['location']; $image_name = $row['image_name']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/314538-how-to-create-a-search-with-multiple-tables-with-php-and-mysqli/ Share on other sites More sharing options...
Barand Posted February 9, 2022 Share Posted February 9, 2022 To answer your question I would need to know what tables are in the database and the structures of those tables. Quote Link to comment https://forums.phpfreaks.com/topic/314538-how-to-create-a-search-with-multiple-tables-with-php-and-mysqli/#findComment-1594012 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.