Is there a reason why pnVarPrepForStore has been moved out of the SQL statements and into a list prior to the SQL statements in the Example module?
The Template module used pnVarPrepForStore right in the SQL statement and that seems like the more efficient method. I am not sure why this was changed, unless it presents a security flaw.
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- jmvaughn responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 12:05 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
pnVarPrepForStore
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
This was a case of simplifying the code a little bit to aid readability. All the pnVarPrep* API's handle arrays as input and will act accordingly on each element of that array. So it made sense to call pnVarPrepForStore once with each of the values. This simplifies the SQL statement by having the data pre-prepped for the database
-Mark
--
Visit My homepage and Zikula themes. -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 52
Thanks Mark. I wonder if improving the simplicity of the SQL statement (having the data pre-prepped for the database) translates into improved performance. It must, but then how would one measure this, read/write time of SQL execution? -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Given all of the work is done before supplying the query to adodb there is actually no difference to performence. The use of pnVarPrepForStore in the SQL statement of the template module doesn't make any difference to ADODB. There may be a minor performence improvement by only calling pnVarPrepForStore only once but the difference will be minor.
-Mark
--
Visit My homepage and Zikula themes.
- Moderated by:
- Support
