I don't think this is a Fabrik issue and I have included it over at joomla.stackexchange as well, but I am posting it here just in case something is happening with Fabrik in the background that I am not aware of.
I have a JFactory insert that is producing a strange result. For some reason that I cannot determine, it inserts a blank record and then about 20 seconds later the proper record that was submitted by the user is written. Here is the code for the insert:
The settings for the database table are:
The records look like:
As a postscript, I'll add the following information. I don't think it is important, but just in case something is going on in the background it will be noted.
The table and elements were created by Fabrik and the table can be displayed by Fabrik.
The insert statement was done outside of the Fabrik realm, with the code actually placed inside of an article using Sourcerer {source} {/source} tags.
Any help in figuring this out is greatly appreciated.
I have a JFactory insert that is producing a strange result. For some reason that I cannot determine, it inserts a blank record and then about 20 seconds later the proper record that was submitted by the user is written. Here is the code for the insert:
Code:
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Determine the value for the next record
$columns = array( 'email_address', 'url', 'username');
$values = array($db->quote($email), $db->quote($url), $db->quote($userid));
// Build the query
$query
->insert($db->quoteName('review_requests'))
->columns($db->quoteName($columns))
->values(implode(',', $values));
// Execute the query
$db->setQuery($query);
$db->execute();
The settings for the database table are:
Code:
1 id Primary int(11) No None AUTO_INCREMENT
2 date_time timestamp Yes CURRENT_TIMESTAMP
3 email_address varchar(255) latin1_swedish_ci Yes NULL
4 url varchar(255) latin1_swedish_ci Yes NULL
5 username int(11) Yes NULL
The records look like:
Code:
20 2015-08-01 11:39:52 0
21 2015-08-01 11:40:13 frank@sbcglobal.net http://test.com 402
As a postscript, I'll add the following information. I don't think it is important, but just in case something is going on in the background it will be noted.
The table and elements were created by Fabrik and the table can be displayed by Fabrik.
The insert statement was done outside of the Fabrik realm, with the code actually placed inside of an article using Sourcerer {source} {/source} tags.
Any help in figuring this out is greatly appreciated.