How to show total form submissions?
Permalink
I want to show the total number of form submissions on my web page. I want the number to update with every submission, is this possible?
I would imagine that there is somewhere in the database that has the info and I just have to pull the data but I am a newb at php.
Please help me! :)
I would imagine that there is somewhere in the database that has the info and I just have to pull the data but I am a newb at php.
Please help me! :)
Hey guys show some love. :) Anyone have a suggestion? Did I forget to say pretty please?
try waiting more than a couple hours- you can't expect to get answers that fast. It looks like this is how the core does it
it should work, but that has some inapplicable code as well.
$c=$this->getCollectionObject(); $db = Loader::db(); $tempMiniSurvey = new MiniSurvey(); $pageBase=DIR_REL.'/' . DISPATCHER_FILENAME . '?cID='.$c->getCollectionID(); if( $_REQUEST['action'] == 'deleteForm' ){ $this->deleteForm($_REQUEST['bID'], $_REQUEST['qsID']); } if( $_REQUEST['action'] == 'deleteResponse' ){ $this->deleteAnswers($_REQUEST['asid']); } //load surveys $surveysRS=FormBlockStatistics::loadSurveys($tempMiniSurvey); //index surveys by question set id $surveys=array(); while($survey=$surveysRS->fetchRow()){
Viewing 15 lines of 43 lines. View entire code block.
it should work, but that has some inapplicable code as well.
I wasn't being impatient I just didn't want my thread to get lost in the sauce. :) I appreciate your response and you for taking the time to answer me.
I will be trying this tonight but I don't really understand it all. I'm a newb at php (and I mean extremely dumb at it) so forgive me.
Thanks
I will be trying this tonight but I don't really understand it all. I'm a newb at php (and I mean extremely dumb at it) so forgive me.
Thanks
I tried dropping that in a div but I have no clue what I am doing here. Can someone chime in please?
Thanks
Thanks
Not sure what you mean by dropping in in a div, because div is html and the code above is php. So you should do something like <div><?php //code above ?></div> will display the list above. But the code above will just give you a list of numbers (count of file summits, just fyi.
Thanks for replying codingpenguins! :)
I did what you suggested earlier but I just checked back and it turns out it was my error. Instead of putting <?php I put <php?. Newb error. Thanks for the help
I did what you suggested earlier but I just checked back and it turns out it was my error. Instead of putting <?php I put <php?. Newb error. Thanks for the help
I pasted in the code and got this message: Parse error: syntax error, unexpected '}', expecting ',' or ';' in /homepages/41/d382624268/htdocs/themes/theme/default.php on line 109
I've attached the actual file that I am experimenting with.
I've attached the actual file that I am experimenting with.
okay, its not a great solution but it should work. Ended up just going straight through db.
Awesome! Thanks a million. I just want to ask you 2 questions.
Can I delete messages in the reports section and the count stay?
Can I reset the number? If so, what table do I have to edit?
Thanks, you guys rock!
Can I delete messages in the reports section and the count stay?
Can I reset the number? If so, what table do I have to edit?
Thanks, you guys rock!
I found out the answer to my first and second question and it reset it. Is there any harm to letting the entries pile up, like if I had 500 of them?
If so is there anyway to keep the number and be able to delete the entries?
If so is there anyway to keep the number and be able to delete the entries?
no harm, but theres no way to delete them and keep the number.
1) I I think so.
2) Just delete the block and add it again.
2) Just delete the block and add it again.
Fantastic thanks!