I am glad somebody asked this question. I have been thinking about the same thing for few months now.
The question you have answered became de facto a canonical for most mysqli problems. I consider it the most important question in that tag, even though you have provided a similar answer to other questions too.
The problem is that this question is not one which naturally comes up when you get one of the cryptic PHP error messages and you paste it into your search engine (e.g Google, Bind, Duck Duck Go). In fact, even searching for it when you know of its existence is not easy.
I propose a few solutions to this problem. They are open to criticism and discussion and I admit my efforts in driving more traffic to this canonical have not been met with significant results.
Add more SEO keywords to the question.
This is something I have thought about, but I still do not know what we could add to make the question more searchable. Possibly add more of these error messages, which users get when they don't enable mysqli error reporting.
Here are some examples:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given... what should I do?
I keep getting the error message "mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given". Can anyone please tell me why?
WarningWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
hi..i have an error in my programming...its showing Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean
This phrase is probably seen most often:
... expects parameter 1 to be mysqli_result, boolean given ...
yet, Googling it does not get you the canonical post you should see.
Hammer as many posts as possible and edit the ones which were incorrectly closed.
I know you are already doing this, but we need to relink the questions which were incorrectly closed.
I have asked a meta-question about it long time ago, but people still use the wrong canonical. Some have argued with me that the wrong one is still helpful, but that is pure nonsense. These two APIs are completely different even if the difference in name is just one letter.
There's way more questions closed as a duplicate of the old API then there is of the new one. We have been telling people for the past 10 years to stop using the old mysql_*
API, but we can't deny the truth that it was more popular then the new mysqli, which was meant to replace it.
Clean up! Delete old duplicates and useless questions.
The ludicrous method of checking and displaying the error message manually persists among the PHP community for unbeknown to me reasons. If anyone suggests this, I simply downvote such answer. However, there is plenty of questions, which got such an answer and are can be closed and deleted. We do not need to keep the wrong information on the site in such volumes.
Another point is that we can and probably should delete a lot of questions, which asked about the mysql_*
API. Search engines incorrectly drive traffic there, because of the letter i
in mysqli
. The computer systems thing it is a typo and show the more popular results for mysql_*
API. In hindsight, it was probably a stupid decision to name the new API this way. This API has been deprecated for almost 4 years now and completely removed since 2019. We can keep some small subset of useful questions more historical reasons, but most questions are good to go. Do we need >1000 duplicates asking how to see errors in mysql_*
API if no one should be using that API? These unnecessary duplicates only propagate bad practices and are not helping anyone anymore.
Retag questions
What I have noticed is that the Stack Overflow duplicate search takes tags into consideration. If the question does not have mysqli tag, it suggests the old mysql_*
canonical and users pick that one mistakenly. If you add mysqli tag, the system suggests the correct one most of the time.
Adding the mysqli tag to questions which contain the error message "mysqli* expects parameter 1 to be mysqli_result, boolean given..." does help in driving more traffic there.
mysql_*
API was. When the question is not tagged with mysqli the system actually suggests the question for the old API as more suitable. Your meta question would be better worded if you were to seek options to improve SEO of that particular question with details and research. – Dharman Apr 5 '20 at 12:55