If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
-
amyat
- Veteran Member
- Posts: 45
- Joined: 2020-06-24 20:39
Post
by amyat » 2020-08-14 10:40
hi,
help me please
https://imgur.com/tmTRG7p
function student_form_before_insert(&$data, $memberInfo, &$args) {
if( $memberInfo['group']=='guest'){
Update membership_userpermission => insert=0, update=1 where username =$memberInfo['username'] for student_form table;
return TRUE;}}
I think I'll need to create userpermission first.
I have not enough knowledge coding
can u help me please

-
amyat
- Veteran Member
- Posts: 45
- Joined: 2020-06-24 20:39
Post
by amyat » 2020-08-14 10:42
sry for wrong color font
i'm so idiot
-
pbottcher
- AppGini Super Hero

- Posts: 1709
- Joined: 2018-04-01 10:12
Post
by pbottcher » 2020-08-14 19:13
you can try
Code: Select all
$table = "student_form";
$sql = "INSERT INTO `membership_userpermissions`(`memberID`, `tableName`, `allowInsert`, `allowView`, `allowEdit`, `allowDelete`) VALUES ('" . $memberInfo['username'] . "', '" . $table . "', '0', '1', '1', '1')";
sqlvalue($sql);
But I'm not sure you need to set it in the before function. I would rather put it in the after_insert.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
amyat
- Veteran Member
- Posts: 45
- Joined: 2020-06-24 20:39
Post
by amyat » 2020-08-15 19:31
It's work.
i used it in the after_insert.
Thank you so much kind Sir