Skip to content
Advertisement

mysql query return boolean but I expect to return id

This is my query:

JavaScript

What is wrong in this query? I’m expecting like in nested where id is compared to 108 and result will be greater than 108 but it returns boolean

calling function with parameters like nextIdUserInquiry(108, $con, ‘N’);

and whole function body is below

JavaScript

and mysql error is that

Call to a member function fetch_assoc() on boolean in C:xampphtdocsbesttouradminconnect_db_test.php

Advertisement

Answer

the inner query returns a queryset, therefore you can’t use ...where id=(select... try instead ...where id in (select...

or even better try with the following:

JavaScript

(tanks to P.Salmon)

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement