-
sso ticket Problem
Hello i have a problem with my ticket :D i use the butterfly r63b Emu here the code
PHP Code:
$token = $Core->SSO_TICKET("$username");
$SQL=mysql_query("SELECT * FROM user_tickets WHERE userid = '".$my_id."'");
echo mysql_error();
$N=mysql_num_rows($SQL);
if($N==0){
mysql_query("INSERT INTO `user_tickets` SET `user_tickets`.`userid` = '".$my_id."', `user_tickets`.`sessionticket` = '".$token."', `user_tickets`.`ipaddress` = '".$myrealip."'") or die(mysql_error());
}else{
mysql_query("UPDATE `user_tickets` SET `user_tickets`.`sessionticket` = '".$token."', `user_tickets`.`ipaddress` = '".$token."' WHERE `userid` = '".$my_id."'") or die(mysql_error());
}
$ticketsql = mysql_query("SELECT * FROM user_tickets WHERE userid = '".$my_id."'") or die(mysql_error());
$ticketrow = mysql_fetch_assoc($ticketsql);
core:
PHP Code:
function SSO_TICKET($username) {
$data = "ST-";
for ($i=1; $i<=6; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-";
for ($i=1; $i<=20; $i++){
$data = $data . rand(0,9);
}
$data = $data . "-lavvo-beta-fe";
$data = $data . rand(0,5);
return $data;
}
the problem: when i'm logging in into the client then says: Login error: System.InvalidCastException: Object can not from the DBNull be converted into other types
can any help? sorry for my bad english i'm german