It seems to me that the problem is not with the questions, but with the answers. What's a trivial question to you is not a trivial question for a beginner. Indeed, an accepted answer which consists solely of this isn't very good:
Use mysql_insert_id()
Even then it could be worse, at least there was a link to the actual documentation.
deceze's edit significantly improves the question. Multiple possibilities, with a discussion of when they should be used: this is how a Stack Exchange answer should look like. Stack Exchange is, after all, a questions and answers site, not a link collection.
Do note that your example question is not a “general reference” question as generally practiced on the Stack Exchange sites that have it (Science Fiction & Fantasy and English Language & Usage). “General reference” started out as
this question is too basic; the answer is indexed in any number of general internet reference sources designed specifically to find that type of information.
and was made popular via Borror0's diagram. But over time I've come to like this diagram less and less, and so have many other participants on SF&F. I'll reiterate what I wrote before SF&F even launched:
It's “Wikipede it first”, not “Google it first”.
(Substitute Wikipedia for whatever reference is applicable: a dictionary, the library reference manual, …)
Relying on Google is problematic, because it doesn't say anything about how reliable the search results are. If you say “google it first”, you may be refering people to W3schools — are you sure this is what you want? If I google the title of your example question, I get:
- Stack Exchange
- Stack Exchange (duplicate? I'll let topic experts judge.)
- official manual —
mysql_insert_id
- official manual —
mysqli::$insert_id
- Stack Exchange
- Coding Forums
- W3Schools
- Vision.to
- Hardcode
- PHP Rockers
I have no idea which of the results are good answers. Keep in mind that the official PHP documentation may have its page rank boosted by being linked so much from SO, which has a huge rank. If you suppress this kind of question on SO, the first search results may well be on sites that peddle bad advice.
On SF&F, most of us have come to agree that Google is irrelevant in determining whether a question is general reference. We only close questions as GR when the subject matter can easily be looked up in a known-reliable (or at least presumed-reliable) reference — for us, this is mainly Wikipedia. I don't have the exact number, but not many questions have been closed as GR, and several of those involved debates as to whether the question was really GR or whether the Wikipedia article had enough detail — and if the question triggers such debate, there's a good change that the subject is not a “too basic” one. In a recent debate, we concluded (+20/-5) that we could easily live without the general reference close reason, because it causes more trouble than it's worth.
I'm a moderator on both SF&F and one of the language sites (not English, which has the “general reference” close reason, but French, which doesn't). My experience on SF&F is that GR isn't really useful as a close reason. Ok, we can close a few questions that aren't helping the site, because Wikipedia answers them better. But it's not much in the grand scheme of things — and there is an argument that GR questions are “getting-to-know-you” questions that drive traffic to the site.
On language sites, I think GR does more good than bad. We do get questions that are not doing any more than asking the meaning of a word, and where the asker is satisfied by a dictionary quote. Even then, I have seen GR being abused, when the question was about fine usage distinctions that are not covered in dictionaries. Still, I think GR would be a useful tool on language sites, as long as (like other tools) it's wielded carefully.
By the way, since French.SE doesn't have GR as a close reason, we use “too localized”, because a question that can be looked up in a dictionary is not going to help future visitors — not when they would have an easier time looking up the answer in their dictionary than finding it via a search engine or Stack Exchange search.
On Stack Overflow, I think GR as a close reason would be awfully abused. Programmers tend to say RTFM a lot. Sometimes it's warranted, sometimes it isn't. GR closure contributes to drive the quality up by excluding too-basic questions, but it also contributes to drive the quality down by excluding interesting answers. (Think Eric Lippert.) SO already struggles to provide answers that go beyond providing a line of code and explain how and why it works. GR closures would make it even harder to get answers to “why” questions.
We're circling back to my original point: basic questions are fine if they attract interesting answers. If you feel that a question truly does not merit a better answer than what is in the official manual, close as “too localized”. If you feel that a question is basic and boring, downvote it and move on. If you see a basic question with a one-line zero-effort answer, do not upvote it and write a better one.
The real problem isn't basic questions, but basic questions with basic answers. You can fight basic answers by not upvoting them. Or by dispelling the fiction that more upvotes means a better post. Yes, I realize this is hard — most upvoters aren't reading Meta, and that big number next to the answer makes it look good, as does the big number next to the author's name. But it's the way Stack Overflow works: quick and dirty answers are favored. Encourage long, thoughtful answers, and the good content will naturally overshadow the too-basic content.
And "you should have found this" isn't helpful unless you're telling the asker exactly where they should have looked.
The canonical reference for the technology being used. I do think a URL should be provided, but in general<technology> documentation
is sufficient, and if the OP hasn't read all of that documentation before resorting to asking for help then they are not sufficiently invested in their project to be "allowed" to get someone else to do the research for them for free. I think "you've read the official documentation for the tools you're using" is a fair baseline.