so it's been 2 hours since I started working on this problem. I only get Invalid Request (UNEXPECTED EOF)
in my CLI and not be able to debug. This is the class I created:
$newUserLastID = NULL;
function addNewUser($request, $team) {
global $newUserLastID;
$db = new db();
$db->setErrorCallbackFunction("myErrorHandler", "text");
$status = "1";
$activated = "1";
$randString = generateRandomString();
$hashed = password_hash($randString, PASSWORD_BCRYPT);
$db->insert("accounts", array(
"team" => $team,
"username" => $request,
"nickname" => $request,
"password" => $hashed,
"status" => $status,
//"recruiter" => $recruiterID,
"activation" => $activated,
"textpword" => $randString
));
$newUserLastID = $db->lastInsertId();
return $newUserLastID;
}
And when I want to get the $newUserLastID
value,
$somevar = addNewUser('DummyData', 'DummyData2');
The code is being executed but, I always get Invalid Request (UNEXPECTED EOF)
in my CLI and it stops. What do you think is wrong with my code?