Hi, I'm italian and my english is not good,
I'm creating a form for my website. how to threshold number of records?
Data submitted in the 50th, can appear a message that says there's more space?
Thanks a lot!
I'm creating a form for my website. how to threshold number of records?
Data submitted in the 50th, can appear a message that says there's more space?
Thanks a lot!
Hi ricky.10,
I'm not sure that I understand. Please post in Italian and I'll try a Google translation.
Non sono sicuro di aver capito. Si prega di post in lingua italiana e cercherò una traduzione di Google.
Bob
I'm not sure that I understand. Please post in Italian and I'll try a Google translation.
Non sono sicuro di aver capito. Si prega di post in lingua italiana e cercherò una traduzione di Google.
Bob
Hi Bob,
thanks for your answer.
Io vorrei limitare a 20 i records che possono essere inseriti in un database utilizzando un form creato con ChronoForms.
Gli utenti del mio sito, quando nel form sono stati inseriti 20 records, dovrebbero ricevere un messaggio che impedisce l'inserimento di altri dati.
E' possibile?
Thanks a lot!!!
Riccardo
Google translation:
I would like to limit to 20 the records that can be inserted into a database using a form created with ChronoForms.
The users of my site, when in form were inserted 20 records, should receive a message that prevents the inclusion of additional data.
thanks for your answer.
Io vorrei limitare a 20 i records che possono essere inseriti in un database utilizzando un form creato con ChronoForms.
Gli utenti del mio sito, quando nel form sono stati inseriti 20 records, dovrebbero ricevere un messaggio che impedisce l'inserimento di altri dati.
E' possibile?
Thanks a lot!!!
Riccardo
Google translation:
I would like to limit to 20 the records that can be inserted into a database using a form created with ChronoForms.
The users of my site, when in form were inserted 20 records, should receive a message that prevents the inclusion of additional data.
Hi Riccardo,
Yes, you can do this.
You need to add a check at the beginning of the Form HTML and show a message if the count is more than 20 records.
Bob
Google translation:
Sì, è possibile effettuare questa operazione.
È necessario aggiungere un controllo all'inizio del form HTML e mostrare un messaggio se il conteggio è più di 20 record.
Non testato e avrà bisogno di debug. Sarà necessario inserire la tabella corretta e nomi di colonna.
Yes, you can do this.
You need to add a check at the beginning of the Form HTML and show a message if the count is more than 20 records.
<?php
$user =& JFactory::getUser();
$db =& JFactory::getDBO();
$query = "
SELECT COUNT(*)
FROM `#_some_table`
WHERE `user_id` = ".$user->id."
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count > 20 ) {
echo "Avete già 20 record";
return;
}
?>
Not tested and will need debugging. You will need to enter the correct table and column names.Bob
Google translation:
Sì, è possibile effettuare questa operazione.
È necessario aggiungere un controllo all'inizio del form HTML e mostrare un messaggio se il conteggio è più di 20 record.
Non testato e avrà bisogno di debug. Sarà necessario inserire la tabella corretta e nomi di colonna.
Hi GreyHead,
good day, thank you for your cooperation.
Unfortunately I can not solve my problem.
The form that I created is at this address:
http://www.messedagliavr.it/index.php?option=com_chronocontact&chronoformname=autogestione
I wish that in the last four fields, when the option 1 was selected 20 times, it becomes impossible to choose option 1 again.
Can You help me?
Thanks a lot!!!
Riccardo Fantoni
good day, thank you for your cooperation.
Unfortunately I can not solve my problem.
The form that I created is at this address:
http://www.messedagliavr.it/index.php?option=com_chronocontact&chronoformname=autogestione
I wish that in the last four fields, when the option 1 was selected 20 times, it becomes impossible to choose option 1 again.
Can You help me?
Thanks a lot!!!
Riccardo Fantoni
Hi Riccardo,
I can tell nothing useful from looking at the form.
What have you done with the code I posted earlier?
Bob
I can tell nothing useful from looking at the form.
What have you done with the code I posted earlier?
Bob
Hi Bob,
I inserted the code you've mentioned, but I did not understand how to reference the column that interests me.
The point where I enter the table name and column is this:
FROM `#` _some_table
WHERE `user_id` = ". $ User-> id."
Right?
But How I enter the name of the column, in my case "primoturno", for the choice "option 1"?
Sorry if questions seem trivial, but I'm inexperienced about the php code.
Thank you
Riccardo
I inserted the code you've mentioned, but I did not understand how to reference the column that interests me.
The point where I enter the table name and column is this:
FROM `#` _some_table
WHERE `user_id` = ". $ User-> id."
Right?
But How I enter the name of the column, in my case "primoturno", for the choice "option 1"?
Sorry if questions seem trivial, but I'm inexperienced about the php code.
Thank you
Riccardo
Hi Riccardo,
That doesn't look much like the code that I posted, there are several bits missing or misplaced.
It looks as though you need to find a basic MySQL tutorial to understand how this works.
Bob
That doesn't look much like the code that I posted, there are several bits missing or misplaced.
It looks as though you need to find a basic MySQL tutorial to understand how this works.
Bob
Hi GreyHead,
i am looking for a simple way of displaying the number of records in my chronoconnectivity page. I saw the code above and thought this would solve my problem. Modified the code as follows:
<?php
$db =& JFactory::getDBO();
$query = "SELECT COUNT(*) FROM 'jos_chronoforms_vrienden'";
$db->setQuery($query);
$count = $db->loadResult();
echo "recordtotal :".$count;
?>
the value $count isn't filled. Any ideas? Table name is correct. Also tried it with the # in front.
THanks in advance,
Baljé
p.s. i also tried count($rows) this returns 0.
i am looking for a simple way of displaying the number of records in my chronoconnectivity page. I saw the code above and thought this would solve my problem. Modified the code as follows:
<?php
$db =& JFactory::getDBO();
$query = "SELECT COUNT(*) FROM 'jos_chronoforms_vrienden'";
$db->setQuery($query);
$count = $db->loadResult();
echo "recordtotal :".$count;
?>
the value $count isn't filled. Any ideas? Table name is correct. Also tried it with the # in front.
THanks in advance,
Baljé
p.s. i also tried count($rows) this returns 0.
Hi baljee,
You need backquotes `` round the tablename (not single quotes)
Bob
You need backquotes `` round the tablename (not single quotes)
$query = "SELECT COUNT(*) FROM `jos_chronoforms_vrienden`";
Bob
This topic is locked and no more replies can be posted.