Jump to content

Hi, have a qustion please


Go to solution Solved by Barand,

Recommended Posts

Here is a message error that I got after trying to get a data from a database by pressing search button:

 

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given inC:\xampp\htdocs\E-commerce-website\functions\common_function.phpon line237

 

Here is the code it is a function call search_product:

function search_product(){

    global $con;

    if(isset($_GET['search_data_product'])) {

      $search_data_value=$_GET['search_data'];

        $search_query="select * from `products` where

        product_keywords like `%search_data_value%`";

        $result_query=mysqli_query($con,$search_query);

        while($row=mysqli_fetch_assoc($result_query)) {

            $product_id=$row['product_id'];

            $product_title=$row['product_title'];

            $product_description=$row['product_description'];

            $product_image1=$row['product_image1'];

            $product_image2=$row['product_image2'];

            $product_image3=$row['product_image3'];

            $product_price  =$row['product_price'];

            $category_id=$row['category_id'];

            $brand_id=$row['brand_id'];

 

            echo "   "          

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.