Hi, I've installed Chronoforms in Joomla....all is ok.
Now, I've transpose my project in Wordpress....but there is a problem:
In a Custom code I've this string:
<?php
$db = \JFactory::getDBO();
$query = "
SELECT `cognomeosp`
FROM `wpds_cf_test3`
WHERE `cf_id` = '{$form->data['dropdown']}' ;
";
$db->setQuery($query);
$form->data['cognomeosp'] = $db->loadResult();
How I can translate "$db = \JFactory::getDBO();" for Wordpress?
And...is there another error in this string for wordpress use?
Please, help me.
Matteo
Now, I've transpose my project in Wordpress....but there is a problem:
In a Custom code I've this string:
<?php
$db = \JFactory::getDBO();
$query = "
SELECT `cognomeosp`
FROM `wpds_cf_test3`
WHERE `cf_id` = '{$form->data['dropdown']}' ;
";
$db->setQuery($query);
$form->data['cognomeosp'] = $db->loadResult();
How I can translate "$db = \JFactory::getDBO();" for Wordpress?
And...is there another error in this string for wordpress use?
Please, help me.
Matteo
Hi Matteo,
Here is an example wordpress query:
Best regards,
Max
Here is an example wordpress query:
<?php
global $wpdb;
$metakey = "vatnumber";
$dbquery = $wpdb->prepare("SELECT meta_value FROM ".$wpdb->prefix."usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $metakey);
$vatnumber = $wpdb->get_var($dbquery);
?>
Best regards,
Max
This topic is locked and no more replies can be posted.