2 users online. Create an account or sign in to join them.Users
SymQL: Output?
This is an open discussion with 5 replies, filed under General.
Search
By default it returns an XMLElement, so it can be a straight DS drop-in replacement. But you can get arrays and stuff too:
https://github.com/nickdunn/symql#run-the-query
RTFM :-)
Sorted. Thanks.
Sorted. Thanks.
Sorted twice! Now that is cool.
John, how did you use SymQL to get the value in the end? XML or a PHP array?
Sorry, got it! $res['section']['entries'][$_POST[id]] etc... :)
Create an account or sign in to comment.
How do I use the output from the SymQL extension? What is the output? It looks like an XMLElelement Object.
I have added the following code to an event, to get the ID for the entry in question:
if($_POST['fields']['name'] && $_POST['fields']['email-address'] && $_POST['fields']['un-subscribe'] == 'yes'){ $query = new SymQLQuery(); $query->select('system:id')->from('subscriptions')->where('email-address', $_POST['fields']['email-address'])->where('name', $_POST['fields']['name']); $res = SymQL::run($query); $entry = current($res); $_POST['fields']['id'] = $entry->id; // This doesn't work. $_POST['fields']['subscribed'] = 'no'; unset($_POST['fields']['un-subscribe']); }How do I get the ID for the entry returned?