Hello,
I have a script that I'm trying to adapt to the PHPMaker event in "Form_CustomValidate".
When the client logs in the system will check if there is one record in a specific table and if not it will create one record.
Basically this is how it works.
table: "profile" has a field called user_id and I check to see if there is one record with the same id as the users account in users.userid and if not I create one record that the user can then edit.
Here's how I did it in PHP, but not sure about PHPMaker. Thanks for any help.
$MyField = ew_ExecuteScalar("SELECT id FROM users WHERE profile.USER_ID=id");
$rowUser = mysqli_fetch_array( $MyField );
$USER_ID = $rowUser["USER_ID"];
if (!$USER_ID) {
// Do something here insert one record.
}else{
// Do nothing because one record exist.
}