How to limit to a specified number the new records

Status
Not open for further replies.

sergio

New Member
Hi guys,
now I've te necessity to limit (for the loggin in user) the insert of new record...
So, every single registered user can insert only 3 record in the specified table, if he can to insert the 4th record an error message could be show....
How can i do it?

tnxxx
 
theres no way to do this at the moment, what you would need to do is to write a custom form plugin (or write a custom php script for the fabrikphp form plug-in) that would check the number of records already created when inserting a new record
 
Tnx Rob for reply

could you suggest me a track of the possible php script please, using for exemple {my->email} as field of "check"...

tnx for support
 
the query I need could be:

$query= mysql_query("SELECT COUNT(*) FROM your_table WHERE your_column = 'user_logged' ");
$r = mysql_fetch_array($query);
echo $r[0];
if($r[0]<=3){echo"you can't insert new record";}

but... how can I use it in "Run PHP" plugin in Fabrik? ???

tnxxxxxxx
 
Rob didn't realize this was the 1.0 forums.

Unfortunately, you can't abort a form submission in 1.0 using the PHP form submission evals. So basically there is no way to do this in 1.0.

-- hugh
 
Hi hugh,
in effect I've supposed that with 1.0 it can't possible...

I move the question in 2.0 forum......
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top