Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112312 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50969 invoked from network); 28 Nov 2020 16:59:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Nov 2020 16:59:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 76AAE1804CA for ; Sat, 28 Nov 2020 08:26:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 28 Nov 2020 08:26:39 -0800 (PST) Received: by mail-ed1-f53.google.com with SMTP id c7so1226084edv.6 for ; Sat, 28 Nov 2020 08:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=TV1s9sg9sCH10AM4rskLWRiIFT70DFhh1rRKhhT3ku0=; b=g6kvvsTuw2jJXQRqKx86VoCw3cH59TDLBZWM3bWZglfTe0P+347l7sLPbIBfEWegJs gEkVND7kt4356X+mOHa6ErakbE6V0etccArFPkHkGtQb61f0OBWyNrUrw1h2h5ieGQOw 5qM1uWD203kwCt7EA761HD22AicBQLlKctoH89om2ClnHEp8o2VU8beORZCUt8yNmjS+ sAuEgOEEGu4nYaMnm9IA3JkLCRQkwkjgwNl4/c9nbke7REpd0P9DGGEGW16whVCyCOc9 9Wlik2RWzi3wu/zgrCizSKTqEaz8wsh8Z0ocvxOy9Zunw2PWs+C7LOncPv0HtLwhjmX0 k58Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=TV1s9sg9sCH10AM4rskLWRiIFT70DFhh1rRKhhT3ku0=; b=kXKMEalQ9UvumjCZ7DYNlGO7wLl0W8/e5tHYD360ta8CKe6JmC85KMMzhBOBd6lshf 16N1DcQeqV30crCFgKfrqbjqi4XxgRpvYKLT1lZk5xADzeffHtQv8LsaW3lRT1zBIyXT Jxsqea2fkEjMTEAqRi7Wnz/yO8zfP3A1YPiM0excbCwo9LLSn4ZplEG3KxR1QZtfWdsU oJ27WjnhzkXg/361xp8ejFOsJTHhpGH33MrKUBs2IuJt7o1dduQRgcLYuMfNe9CtQ4pG j9GY8qTTB/+QJp7Au/QeAyvCgF6XU/DH+n4ZMGBxnBMmGvbdPoWgYG8Fan/cgZvLoWFR 4hHw== X-Gm-Message-State: AOAM5336qPCY+evY7Tg1QbWNTqNQwvvuLfsrsGmZrFLcoJhzjXihbUVq N3BVlaf5tfB8piVf+cy5zDMYX+ylb9Tpy3T8bpVrG6/MdOnLMg== X-Google-Smtp-Source: ABdhPJxwCv/6pu0a4ue4zAUb/w2bhX4IG5qUMavJAunftLe7X8eP8ocjlfHe/k5/7EEna6ftgdqCastVye146aGMlvI= X-Received: by 2002:a50:fe8d:: with SMTP id d13mr7577053edt.132.1606580795371; Sat, 28 Nov 2020 08:26:35 -0800 (PST) MIME-Version: 1.0 Date: Sat, 28 Nov 2020 16:26:25 +0000 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: MySQLi extension basic examples From: tekiela246@gmail.com (Kamil Tekiela) Hi Internals, I would like to hear your opinions about the following page in the PHP manual: https://www.php.net/manual/en/mysqli.examples-basic.php Currently, this is the only "example" apart from the quick start guide. There is a whole section https://www.php.net/manual/en/mysqli.examples.php which suggests that there were more or that there was meant to be more examples, however there is only that one example now. People have complained about the quality of this example for a number of years, including myself. The page does not show best practices, encourages SQL injection, poor error handling, and lacks prepared statement example. As a result, it does more harm than good. There are two possible solutions. 1. Get rid of the examples section. 2. Write a proper mysqli example. While I could create a PR suggesting a better example, I would advise that we remove it completely. This API is not suited to be used directly in business logic. This functionality should be wrapped in a database abstraction layer. For this reason, this example is not much more useful than the examples located on each function's own page. Users writing abstraction libraries are interested more in an example for a particular function rather than an overall example. What are your opinions? Would it be ok to remove that page? Best Regards, Kamil Tekiela