We have now opened a commercial services section here on the forum for registered users. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.
Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.
For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
// print_r($data); exit ;
var_dump($array["[MyTable___MyFieldA]"]); exit ;
Array ( [0] => Array ( [0] => stdClass Object ( [wosweb_users___id] => 1013
[wosweb_users___id_raw] => 1013 [wosweb_users___name] => Mishel XXX
[wosweb_users___name_raw] => Mishel xxx[wosweb_users___email] =>
mishel.xxx@gmail.com [wosweb_users___email_raw] =>
mishel.xxx@gmail.com [wosweb_users___username] => XXX...
Array ( [0] => Array ( [0] => stdClass Object ( [wosweb_users___id] => 1013 [wosweb_users___id_raw] => 1013 [wosweb_users___name] => Mishel Makary [wosweb_users___name_raw] => Mishel Makary [wosweb_users___email] => mishel.everlastwellness@gmail.com [wosweb_users___email_raw] => mishel.everlastwellness@gmail.com [wosweb_users___username] => MMakary...
foreach ($data as $group) {
foreach ($group as $row) {
// do stuff with $row->yourtable___yourelements for each row
}
}
<?php
defined('_JEXEC') or die('Restricted access');
// Create my variables, thanks to you
foreach ($data as $group) {
foreach ($group as $row) {
$var1 = $row->TableA___Field1 ;
$var2 = $row->TableA___Field2 ;
$var3 = $row->TableB___Field1 ;
$var4 = $row->TableC___Field1 ;
...
}
}
// Then my query
$db = FabrikWorker::getDBO(false, MyRemoteConnexionID);
$query = "
BEGIN;
INSERT INTO MyTableA (MyField1, MyField2, ...)
values ('$var1', '$var2', ...) ;
INSERT INTO MyTableB (id, MyField1, ...)
values (LAST_INSERT_ID(), '$var3', ...) ;
INSERT INTO MyTableC (add_id, MyField1)
values ( (SELECT MAX(id) from MyTableB) , '$var4', ...) ;
COMMIT;
" ;
$db->setQuery($query);
$db->query();
?>
<?php
defined('_JEXEC') or die('Restricted access');
$db = FabrikWorker::getDBO(false, MyRemoteConnexionID);
// Create my variables, thanks to you
foreach ($data as $group) {
foreach ($group as $row) {
$var1 = $row->TableA___Field1 ;
$var2 = $row->TableA___Field2 ;
$var3 = $row->TableB___Field1 ;
$var4 = $row->TableC___Field1 ;
...
// Then my query
$query = "
BEGIN;
INSERT INTO MyTableA (MyField1, MyField2, ...)
values ('$var1', '$var2', ...) ;
INSERT INTO MyTableB (id, MyField1, ...)
values (LAST_INSERT_ID(), '$var3', ...) ;
INSERT INTO MyTableC (add_id, MyField1)
values ( (SELECT MAX(id) from MyTableB) , '$var4', ...) ;
COMMIT;
" ;
$db->setQuery($query);
$db->execute();
}
}
?>
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO customer (civility, lastname, firstname, email) VALUES ('Dr', 'Maka' at line 3
<?php
defined('_JEXEC') or die('Restricted access');
// Variables
foreach ($data as $group) {
foreach ($group as $row) {
$wos_title = $row->profiles___title_raw ;
$wos_firstname = $row->profiles___firstname_raw ;
$wos_lastname = $row->profiles___lastname_raw ;
$wos_email = $row->wosweb_users___email_raw ;
$wos_country = $row->address___country ;
$wos_code_phone1 = $row->telephones___code_phone1 ;
$wos_phone1 = $row->telephones___phone1 ;
// Query
$db = FabrikWorker::getDBO(false, 3);
$query = "
BEGIN;
INSERT INTO customer (civility, lastname, firstname, email)
VALUES ('$wos_title', '$wos_lastname', '$wos_firstname', '$wos_email') ;
INSERT INTO address (id_customer, country)
VALUES (LAST_INSERT_ID(), '$wos_country') ;
INSERT INTO telephone (id_customer, id_address, code_tel1, tel1)
VALUES ( (SELECT MAX(id_customer) FROM customer) , (SELECT MAX(id_address) from address) , '$wos_code_phone1', '$wos_phone1') ;
INSERT INTO customer_organisme (id_customer, id_organisme)
VALUES ( (SELECT MAX(id_customer) FROM customer) , '1') ;
COMMIT;
" ;
$db->setQuery($query);
$db->query();
}
}
?>