-2

Calling this query:

$result = mysqli_query($conn, "SELECT reviewDetails, reviewTitle, rating, 
          reviewDate, authorName FROM reviews 
          WHERE product_asin IN ($productid, '$asin') AND 
          status = 'published' LIMIT 7 OFFSET 0");

This query isnt showing any output when called from mysqli_query() but working when directly called from SQL PHPMyAdmin

This query is working fine :

$result = mysqli_query($conn, "SELECT reviewDetails, reviewTitle, rating,
          reviewDate, authorName FROM reviews 
          WHERE product_asin IN ($productid, '$asin') AND
          status = 'published' LIMIT 7 OFFSET 7");
Martin
  • 22,212
  • 11
  • 70
  • 132
  • Do you get any error logs? Try hardcoding your variables to check if the issue is the data or the query – Martin Nov 02 '20 at 11:12
  • Does this answer your question? [mysqli\_fetch\_assoc() expects parameter / Call to a member function bind\_param() errors. How to get the actual mysql error and fix it?](https://stackoverflow.com/questions/22662488/mysqli-fetch-assoc-expects-parameter-call-to-a-member-function-bind-param) – Dharman Nov 02 '20 at 17:06
  • @martin yes i tried hardcoding the variables and the result is same i.e. empty/nothing shows not even null. – tushar sharma Nov 05 '20 at 04:19
  • @Dharman thanks i will use these instructions when i will make it live. and no the question you suggested does not solve my question. Thanks. – tushar sharma Nov 05 '20 at 04:21
  • 1
    I think @Dharman was linking that question for structural approaches but also for reference to how to get the actual MySQL error rather than just a false return. And you didn't answer if you got any errors; have you checked? – Martin Nov 05 '20 at 10:40

1 Answers1

0

Few reviews of that product having non english chars

so I have added mysqli_set_charset($conn, "utf8");

after db connection

and it solved my problem :)