Hi,
I am trying to register a user.
Once the user is registered, a call to an external API is made.
It return a clientID.
I need to take this clientID, and save it in the database. …but it doesn’t save the clientID…
Here is my code :
[php]$createAccount = $MySession->register($user, $pass,
array(
“email” => $email,
“name” => $name,
“created” => date(“Y-m-d H:i:s”)
)
);
if($createAccount === “ExistingUser”){
echo “Client already exist!”;
}elseif($createAccount === true){
$response = (Client::add_client(array(‘firstname’ => $user, ‘name’ => $name, ‘email’ => $email)));
$response = array();
foreach($response as $Element){
$IDClient=$Element->clientid;
$hote="localhost";
$usern="XXXXXXX";
$passw="XXXXXXX";
$basedata="XXXXXXX";
mysql_connect($hote,$usern,$passw);
@mysql_select_db($basedata) or die( "Unable to select database");
$query= "UPDATE `users`
SET `clientid` = :'{$IDClient}'
WHERE `email` = :{$email}";
mysql_query($query);
mysql_close();}
}
return true;
echo "HOURRAH! Your account was created :)";
}[/php]
It can create the account, but i doesn’t save the ClientID in the database.
Why exactly?
Thank you in advance