From: Larry G. <la...@ga...> - 2007-10-04 05:28:17
|
Enter the magic of prepared statements. I personally prefer to use PDO, since I like it's interface better than MySQLi's and it supports both named and unnamed parameters. http://www.php.net/pdo It requires PHP 5.1 or later. If you're using an earlier version of PHP, you need to be smacked because anything older than that is dead and the funeral is in process: http://gophp5.org/ http://www.php.net/index.php#2007-07-13-1 Note that if you're using a database other than MySQL, you'll run into some field types that still need special handling. Most notable is LOBs in Oracle and DB2, since those databases still think it's 1988. On Wednesday 03 October 2007, jsWalter wrote: > I'm rolling my own little DB class (pls, I don't need to hear about how > wonder this or that class is, thank you, I've reading over 2 dozen such > libaries) and I have a question to this group... > > Workflow: > 1) submit data form > 2) pull data from POST > 3) "clean" data > 4) update record > > Now, my question deals with step 3. > > On one hand, the cleansing of the data needs to be done by the developer. > > On the other, would it be logical for the DB class to take a whack at the > data set and to make sure each field is the data type that the database is > expecting? Or should the developer code that as well? > > Ideas? > > walter > > > > > ==================================================== > Taking it to the next level. > web.torres.ws/dev/php/walters_way > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss -- Larry Garfield AIM: LOLG42 la...@ga... ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson |