Hi all,
I have a form with some custom code.
(Joomla! Version - Joomla! 2.5.10 Stable [ Ember ] 24-April-2013 14:00 GMT, Joomla! Platform Version - Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT)
I am getting a server error every time the program gets to that code.
Of course the rm_id and rex_card fields exist in the jml_rex_main table.
I am generating a random number but making sure that is unique among the other rows in that table.
This was working up until I did a joomla update yesterday.
Please Help!!!
Thanks
MRFitz
I have a form with some custom code.
(Joomla! Version - Joomla! 2.5.10 Stable [ Ember ] 24-April-2013 14:00 GMT, Joomla! Platform Version - Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT)
I am getting a server error every time the program gets to that code.
<?php
$randmax= mt_getrandmax();
do {
$gc_swipe = mt_rand(100000000,$randmax);
$query = "select rm_id from jml_rex_main where rex_card = '".$gc_swipe."'";
$db->setQuery($query);
$db->query();
}while ($db->getNumRows() <> 0);
$form->data['gc_swipe'] = $gc_swipe;
?>
Of course the rm_id and rex_card fields exist in the jml_rex_main table.
I am generating a random number but making sure that is unique among the other rows in that table.
This was working up until I did a joomla update yesterday.
Please Help!!!
Thanks
MRFitz
Hi The Fitz,
I don't see any particular reason why that code would cause an error unless there have been some changes in the Joomla! db classes.
Probably the first step is to upgrade to 2.5.11 which fixed some bugs in 2.5.10 and see if that helps.
If that doesn't fix it what is the error that you see? Is there a message? Or anything useful visible if you turn site Debug on or set site Error Reporting to Maximum?
Bob
I don't see any particular reason why that code would cause an error unless there have been some changes in the Joomla! db classes.
Probably the first step is to upgrade to 2.5.11 which fixed some bugs in 2.5.10 and see if that helps.
If that doesn't fix it what is the error that you see? Is there a message? Or anything useful visible if you turn site Debug on or set site Error Reporting to Maximum?
Bob
Hi The Fitz,
I don't see any particular reason why that code would cause an error unless there have been some changes in the Joomla! db classes.
Probably the first step is to upgrade to 2.5.11 which fixed some bugs in 2.5.10 and see if that helps.
If that doesn't fix it what is the error that you see? Is there a message? Or anything useful visible if you turn site Debug on or set site Error Reporting to Maximum?
Bob
Hi Bob,
As usual, you hit it right on the nose. I had this error because I was reworking the code and I was cutting and pasting the code to move it around....
DUMMY ALERT But I forgot to "re-paste" these 2 lines at the top of the code.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
Using your suggestion to turn on the debug and error reporting, I immediately realized my error because the debug showed that ....
"$db is not an object"
Then I knew I was the Dummy!!!
Thanks for your quick response.
MrFitz
Hi The Fitz,
We've all been there :-)
Bob
PS If it helps my Unique ID [GH] action does more or less the same thing.
We've all been there :-)
Bob
PS If it helps my Unique ID [GH] action does more or less the same thing.
This topic is locked and no more replies can be posted.