Waspman
Posts: 948
|
Posted: 11/05/2013, 3:56 AM |
|
Been a while since I did anything with CCS.
So a bit rusty:)
...anyone now why this doesn't work...
global $db0;
$db0 = new clsDBConnection1();
$Container->Label1->SetValue(CCDLookUp("password","accounts","accountID=14", $db0));
$db0->close();
_________________
http://www.waspmedia.co.uk |
|
|
jekes
Posts: 36
|
Posted: 11/05/2013, 3:27 AM |
|
Try this
$Container->Label1->SetValue(CCDLookUp("password","accounts","accountID='14'", $db0));
or
$Container->Label1->SetValue(CCDLookUp("password","accounts","accountID=".$db0->ToSQL(14,ccsInteger), $db0));
|
|
|
Waspman
Posts: 948
|
Posted: 11/05/2013, 8:38 AM |
|
This is what fixed...
global $db1;
global $SQL1;
global $C;
global $PW;
$db1 = new clsDBConnection1();
$C = CCDLookup("COUNT(*)","accounts","email=".CCToSQL($Container->email->GetValue(),ccsText), $db1);
if ($C<>1){
$SQL1 = "INSERT INTO accounts (fullname,phone,postcode,email,password,signupdate) VALUES (". $db1->ToSQL($Container->name->GetValue(),ccsText) .",".$db1->ToSQL($Container->phone->GetValue(),ccsText) .",".$db1->ToSQL($Container->postcode->GetValue(),ccsText) .",".$db1->ToSQL($Container->email->GetValue(),ccsText) .",".$db1->ToSQL(CCGetSession("pword"),ccsText) .",Now())";
$db1->query($SQL1);
}else{
$PW = CCDLookUp("password","accounts","email=".CCToSQL($Container->email->GetValue(),ccsText), $db1);
CCSetSession("pword",$PW);
}
$db1->close();
CCToSQL or ToSQL - You decide:)
_________________
http://www.waspmedia.co.uk |
|
|
|