We have about 60 users that submit information on a form regularly (some daily, some weekly - updating existing information).
I use a table I created in the Joomla database. I read the information from the table to prefill a form, then when the submit is done I save the information back into the table (update).
Rsforms is being used (I have been very happy with it), but this is custom Joomla code and rsforms has given tips but they don't support it).
When the user hits the submit button, about 15 mysql writes are done, all about the same number of fields per update. For most users this works great every time but for some it does not.
The big problem, there is no error message to tell the user when the update doesn't work.
There are a small handful of users that consistently struggle with the update not working (note often some of the updates will work and some will not). Some of these users admit they have a slower computer or internet. But occasionally an update will fail with no error message for someone who had no previous problems (note some are sophisticated computer users so tell me exactly what they did and what happened and nothing looks off).
Because it is intermittent, even with the same user, and seems to happen more often in the early morning hours ET, I am suspicious there is a busy server or other issue rather than code,the people who consistently report this often say they have slow internet access or an older slower computer. I have never seen this issue but I am on a fast internet with newer fast desktop.
The problem is no error message is given to warn them the update didn't work.
I am looking for any help to ensure error messages will occur as well as help preventing update problems.
PHP 5.4.45
MySQLi 5.5.42-37.1
Joomla 3.2.3.
Joomla reports all extensions are up to date.
The PHP code (there are about 15 of these writes, all about the same number of fields) is:
// Get new Query object
$query = $db->getQuery(true);
// Fields to update.
$fields = array(
$db->quoteName('wlc') . ' = ' . $db->quote($shwlc),
$db->quoteName('lcw') . ' = ' . $db->quote($shlcw),
$db->quoteName('lcwlevel') . ' = ' . $db->quote($shlcwlevel),
$db->quoteName('tntpoints') . ' = ' . $db->quote($shtntpoints),
$db->quoteName('tntlevel') . ' = ' . $db->quote($shtntlevel),
$db->quoteName('ifmtotal') . ' = ' . $db->quote($shifmtotal),
$db->quoteName('measurements') . ' = ' . $db->quote($shmeasurements),
$db->quoteName('comments') . ' = ' . $db->quote($shcomments),
$db->quoteName('cico') . ' = ' . $db->quote($shcico),
$db->quoteName('miles') . ' = ' . $db->quote($shmiles),
$db->quoteName('lifted') . ' = ' . $db->quote($shlifted),
$db->quoteName('steps') . ' = ' . $db->quote($shsteps),
$db->quoteName('why') . ' = ' . $db->quote($shwhy)
);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('sparkname') . ' = ' . $db->quote($sparkname)
);
$query->update($db->quoteName($blcround . '_summarytable'))->set($fields)->where($conditions);
$db->setQuery($query);
if (!$db->execute()) { print_r("There was a problem while trying to save your information, you numbers likely were not saved (write #4 to database). Please copy and send this to xxxxx" ); die();}
Thanks for any help.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-02-10 20:21:11 |
Closed_By | ⇒ | brianteeman |
1) Use the forums for these types of questions please, forum.joomla.org
2) In Joomla 3.x you should be catching Exceptions thrown by the database
API, not checking for a true/false return. If an Exception is caught, an
error was hit executing whatever was happening behind the scenes.
On Wednesday, February 10, 2016, BusSup notifications@github.com wrote: