Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88958 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54029 invoked from network); 28 Oct 2015 05:59:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2015 05:59:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=ich@peter-prochaska.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ich@peter-prochaska.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain peter-prochaska.de designates 80.67.31.97 as permitted sender) X-PHP-List-Original-Sender: ich@peter-prochaska.de X-Host-Fingerprint: 80.67.31.97 smtprelay05.ispgateway.de Linux 2.6 Received: from [80.67.31.97] ([80.67.31.97:42742] helo=smtprelay05.ispgateway.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/B1-30756-55460365 for ; Wed, 28 Oct 2015 00:59:50 -0500 Received: from [80.187.101.188] (helo=[172.20.10.2]) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.84) (envelope-from ) id 1ZrJlz-00078h-LJ for internals@lists.php.net; Wed, 28 Oct 2015 06:59:47 +0100 Content-Type: multipart/alternative; boundary="Apple-Mail=_EDAA3EB4-C5AF-44E7-B098-F415BB76AD43" Message-ID: Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Date: Wed, 28 Oct 2015 07:00:00 +0100 References: <7E.B8.34476.F759F265@pb1.pair.com> To: internals@lists.php.net In-Reply-To: <7E.B8.34476.F759F265@pb1.pair.com> X-Mailer: Apple Mail (2.1878.6) X-Df-Sender: aW5mb0BwZXRlci1wcm9jaGFza2EuZGU= Subject: Re: [PHP-DEV] Some words about the basic ideas of PHP From: ich@peter-prochaska.de (Peter Prochaska) --Apple-Mail=_EDAA3EB4-C5AF-44E7-B098-F415BB76AD43 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Frank, the basic idea of PHP was to create a powerfull and easy to use = Language, not only for data handling. Data handlng is one of many facets of PHP. One developer uses PHP for data handling, the other for rendering HTML = templates. One uses it for creating a webservice, the other for doing complex = calculations. If you want a easy data handling, use PDO (how Stephen sad) or use = Symfony2 or ZF2, aka a framework, for easy data handling. Regards Peter Prochaska Am 27.10.2015 um 16:17 schrieb Stephen Coakley : > On 10/26/2015 05:09 AM, Frank Meier wrote: >> Hi to all of you, >>=20 >> first I want to apologize for may bad English, >>=20 >> .. . . >>=20 >>=20 >> I write because I feel that that the way how you see your own product = PHP >> is totally wrong. I do not mean with it that the construction of the >> language is wrong. >=20 > Ah, OK. So you're the expert then. PHP is open-source; maybe you'd = like to contribute to make it better? >=20 >> Your basic aproach is wrong. >>=20 >> PHP is a server side programming language. That means that the most = work >> what PHP have to do is to be the boss of the data servers and handle = the >> data. >=20 > I mean, that's the primary environment PHP is used in, but it can be = used for anything really. Straight from the PHP.net homepage: >=20 > > "PHP is a popular general-purpose scripting language that is = especially suited to web development." >=20 >> Create database or tables or records, edit, delete and read and = write >> them. >>=20 >> And where is your fantastic programming language so incredible lousy = that >> me, I am since 35 years a database programmer, just shake my head??? >>=20 >> Exact in this operations!!! >>=20 >> I know that it is for free and I can not tell you how much I value = your >> work on it, but all of you, WAKE UP!!!! >=20 > Your tone of voice is a little comically inappropriate, and it doesn't = sound like you value our work. :) >=20 >> You sent the handling of records from modern handling via recordsets = back >> to computer stone age. It is a torture to use PHP without tools (and = they >> are lousy too) for database operations. >=20 > As already mentioned, try PDO (http://php.net/manual/en/book.pdo.php) = -- its built-in and is just as easy to use as ADO. >=20 > If you want to actually use ADO in PHP, you can do that too with COM = (http://php.net/manual/en/class.com.php). I'd recommend PDO though; its = efficient and easy to use. >=20 >> I can give you a example: >>=20 >> It is in PHP a lot of work to just read the next record in a table. >>=20 >> With ADO is it just nextrecord(). >>=20 >> The PHP way is a insult to the modern world of programming. >=20 > Uh, wait. Where's the PHP example that is "a insult to the modern = world of programming"? You didn't actually give an example for PHP... >=20 > Let me help you out. >=20 > ADO (note I could be doing this wrong...): > SqlCommand query =3D new SqlCommand("SELECT * FROM Foo", = dbConnection); > dbConnection.Open(); > SqlDataReader reader =3D query.ExecuteReader(); >=20 > if (reader.HasRows) > { > while (reader.Read()) > { > Console.WriteLine("{0}", reader.GetString(0)); > } > } > else > { > Console.WriteLine("No rows found."); > } > reader.Close(); >=20 > PDO: > $statement =3D $dbConnection->query("SELECT * FROM Foo"); >=20 > if ($statement->rowCount() > 0) { > while ($row =3D $statement->fetch()) { > print $row[0] . "\n"; > } > } else { > print "No rows found.\n"; > } >=20 >> Maybe you should consider to write internal functions for the record >> handling which do take all the sql waste of time away from the = programmer >> and create just short command words that the developer can use them. >>=20 >> This would be a "small step for you but a huge leap for mankind!". >>=20 >> And you would finally win the race in the language battle. >=20 > Not to brag, but we already did. Some of the biggest websites like = Wikipedia, use PHP. >=20 >> I am sorry that I write it so harsh, but PHP is for me the definition = of >> server data handling and exact there you fail in a big way. >=20 > I'm not sure what your evidence is for that, but thanks for the = laughs. >=20 >> All the programmers around the world reinvent every time the wheel = new? >>=20 >> Have this really to be? >>=20 >> In my opinion should exist commands like: >> recordnew(table) >> recordread(id, table) >> recordwrite(id, table) >> recorddelete(id, table) >> recordprev(currentrecord, table) >> recordnext(currentrecord, table) >>=20 >> This is the minimum what I expect from a program language in the year = 2015. >=20 > No object-oriented programming, iterators, or abstraction, in the year = 2015? Interesting opinion. >=20 >> This should include already the ajax handling and all the other = actions >> that are needed to get or view or write the data. >=20 > AJAX handling is totally irrelevant here. Not sure what it has to do = with DB access, >=20 >> It should also be included table locking and record locking, if = needed. >>=20 >> And special commands for reading multiple records for paginations. >> And also for a easy way to edit a record in this paginations set = (page, >> count) and write this back to the MySQL database or whatever = database is >> used. >>=20 >> .. . . >>=20 >> You are so focused to make PHP better and better that you just forgot = to >> upgrade the basic commands. >>=20 >> A programmer in the year 2015 should not need to fetch records and = do this >> with program code line by line. This was in the year 1982 the case >=20 > Is the program just supposed to "guess" how you want to handle the = data? That's not programming... >=20 >> .. . . >>=20 >> It reminds me on hotels which always renovate the lobby but never the = rooms >> for the guests. >>=20 >> .. . . >>=20 >> I am sorry to be so critical, but this was cooking me since long = time. >>=20 >> I am database programmer for international police organizations. >>=20 >> Please keep my name confident. >>=20 >>=20 >>>=20 >>> Frank Liebl, GER >>> KTTL - Royal Thai Police >>> Federal Police, Headquarters >>> Bangkok 10330, Phatumwan >>> T H A I L A N D >>> Phone: +66 90 243 7837 >>> Email: frankybkk@gmail.com >>> Line: scoobeedo >>> Facebook: scoobeedo cool >>> Web: www.scoobeedo.com >>>=20 >>=20 >=20 > Also, you posted your name on this public mailing list so it is no = longer confidential: http://news.php.net/php.internals/88937. We keep = all communication here public for reference and integrity. >=20 > Thanks for your complaints. It brightened my day. Good luck with = programming! Feel free to ask for some help in ##php on Freenode IRC or = in the php.general mailing list. :) >=20 > --=20 > Stephen >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 --Apple-Mail=_EDAA3EB4-C5AF-44E7-B098-F415BB76AD43--