I have a form with pull down select. I would like to save to mysql the result of select like this:
If select = teacher then in Mysql add into account column value as teacher and in another column add account type as 1 else if select = student then, in Mysql add account value as student and in the other column add account type as 2.
$account = 'account';
if ($account = "Agency")
$accounttype = "1"; //Agency
elseif ($account= "Landlord")
$accounttype = "2"; //Landlord
$user = [
'name' => $this->request->getPost('name'),
'account_no' => rand(),
'email' => $this->request->getPost('email'),
'account' => $this->request->getpost('account'),
'account_type' => $accounttype,
Am able to add the account as either teacher or student but unable to add account type 1 or 2 in the account type column.... help me format my code.