vartron
Posts: 7
|
Posted: 08/13/2014, 9:26 PM |
|
I recreated the exercise practiced (Multi Step registration) by 100% in the project examplepack1, but when I try to do the same in my database MySQL in other project, it gives me the following error:
Call to a member function ToSQL() on a non-object in C:\AppServ\www\patrimonio\NewPage1_events.php on line 112
The line 112 is: $LastID = CCDLookup("max(id_usuario)","usuarios","d_nick=".$DBInternetDB->ToSQL(CCGetFromPost("d_nick",""),ccsText),$DBInternetDB);
-----------------------------------------
This is my code in the after Insert event, is the same but changing the "user_id" for "id_usuario " and changing the tables "user" for "usuarios"
global $DBInternetDB;
global $Redirect;
//Retrieve the last inserted key if a new user is registered
//This method of retrieving the last inserted key is safe because the value of the user_login field has to be unique.
if(!CCGetFromGet("id_usuario",0)) {
$LastID = CCDLookup("max(id_usuario)","usuarios","d_nick=".$DBInternetDB->ToSQL(CCGetFromPost("d_nick",""),ccsText),$DBInternetDB);
if (strpos($Redirect,"?") == false ) {
$Redirect = $Redirect."?id_usuario=".$LastID;
} else if (substr($Redirect,-1) == "?" ) {
$Redirect = $Redirect."id_usuario=".$LastID;
} else {
$Redirect = $Redirect."&id_usuario=".$LastID;
}
}
the user is registered into the database MySQL, but can not continue with the next step by the error
Wtha is the problem, thanks for your time.
|
|
|
|