Quote from: splittingred at Feb 13, 2011, 10:17 PM
Using xPDOObjects and schemas means you get the benefit of the xPDOObject API, as well as compatibility in your queries with multiple database platforms.
+
Quote from: splittingred at Aug 01, 2010, 03:30 PM
It is less complex than straight SQL, because xPDO does things that straight SQL doesnt do, namely:
- Automatic parameter escaping, which prevents charset errors and sql injection attacks
- Shorter code, because you dont have to do all the mysql_* functions
- Easier to read code
- Less error prone code due to abstraction
- Abstraction between drivers, meaning that your xPDO queries will work in MySQL and the future drivers Revo will support (sqllite, postgresql, etc)
-
☆ A M B ☆
- 275 Posts
What is the direct xPDO statement/command for INSERT INTO, please?
modx and ecommerce pro
Quote from: modx.customize at Jun 29, 2011, 08:41 AM
What is the direct xPDO statement/command for INSERT INTO, please?
$obj =$modx-> newObject('modWhatever');
$obj-> save();
-
☆ A M B ☆
- 275 Posts
Thanks. Do you have any idea what php values can be passed to this from FormIt?
Like $fields[’name’] = $_FormIT[’name’];
I mean what would be the correct variable unstead of $_FormIT[’name’] ?
modx and ecommerce pro
Make your snippet a hook in FormIt:
http://rtfm.modx.com/display/ADDON/FormIt.Hooks
[[!Formit? &hooks=`MySnippet`]]
Then the fields should be available like this:
$email = $hook->getValue('email');
$allFormFields = $hook->getValues();
return true;
Be sure to return true if the hook succeeds.
I’m glad I could help.
-
☆ A M B ☆
- 275 Posts
Hi BobRay,
sorry to trouble again but I can not save form value(s) to a custom TV not like standart pagetitle.
Let say, I have a TV email type text id 3.
Definitly this $email = $hook->getValue(’email’); will not work as i am afraid this is reserved to modResource, right?
I think I need to assign a new var for modTV or something like that, assign a TV id 3 a var from the FormIT, and then save.
Can you please help?
modx and ecommerce pro
for saving values to TVs with formit see formit2resource.