$option = array(); //prevent problems
$option['driver'] = 'mysql'; // Database driver name
$option['host'] = 'localhost'; // Database host name
$option['user'] = 'XXXXXXXXXXX'; // User for database authentication
$option['password'] = 'XXXXXXXXXXX'; // Password for database authentication
$option['database'] = 'XXXXX_idevs'; // Database name
$option['prefix'] = ''; // Database prefix (may be empty)
$db = JDatabaseDriver::getInstance( $option );
$db = JFactory::getDbo(); // Get a db connection.
$query = $db->getQuery(true); // Create a new query object.
$columns = array('id', 'username', 'approved', 'f_name', 'l_name', 'email', 'type', 'level', 'signup¬_date'); // Insert columns.
$values = array([userid], [username], 1, [firstname], [lastname], [email], 1, 1, date()); // Insert values.
// Prepare the insert query.
$query
->insert($db->idevaff_affiliates('XXXXX_idevs'))
->columns($db-> idevaff_affiliates ($columns))
->values(implode(',', $values));
// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$db->execute();
Please Log in to join the conversation.
Please Log in to join the conversation.
INSERT INTO `idevaff_affiliates` (`username`, `approved`, `payable`, `f_name`, `l_name`,
`email`, `address_1`, `city`, `state`, `zip`, `country`, `phone`, `type`, `level`,
`signup_date`, `ip`) VALUES ("[username]", 1, "[name]", "[firstname]", "[lastname]", "[email]",
"[address]", "[city]", "[state]", "[zipcode]", "[country]", "[phone]", 1, 1, NOW()+0,
"[registeripaddr]");
INSERT INTO `idevaff_tiers` (`parent`, `child`) VALUES ("[cb_sponsor]", "[cb_member]");
Please Log in to join the conversation.