3
I’m trying to take records from one table and record in another of the same kind, but I’m having this error:
There are no more Rows in the active result set. Since this result set is not scrollable, no more data may be retrieved.
the code is as follows:
$gameuser = $pdo->prepare('SELECT * FROM [omegashop].[dbo].[GameUser] WHERE [token] = :token');
$gameuser->bindParam(':token', $token, PDO::PARAM_STR);
$gameuser->execute();
$result = $gameuser->fetchAll();
foreach($result as $linha)
{
$usuario = $linha['userid'];
$senha = $linha['Passwd'];
$remote = 0;
$query = $pdo->prepare("INSERT INTO [accountdb].[dbo].[".( strtoupper($usuario[0]) ) ."GameUser] ([userid],[Passwd],[GPCode],[RegistDay],[DisuseDay],[inuse],[Grade],[EventChk],[SelectChk],[BlockChk],[SpecialChk],[Credit],[DelChk],[Channel]) values( :usuario, :senha,'PTP-RUD001','12-12-2020','12-12-2020','0','U','0','0','0','0','0','0', :remote)");
$query->bindParam(':usuario', $usuario, PDO::PARAM_STR);
$query->bindParam(':senha', $senha, PDO::PARAM_STR);
$query->bindParam(':remote', $remote, PDO::PARAM_STR);
$query->execute();
}`
Puts a
$query->closeCursor();
after the$query->execute();
– rray
The statement must be executed before Results can be retrieved. @Edit opa diz o inverso vou tentar novo
– Jefferson Mello Olynyki
still continues the error
– Jefferson Mello Olynyki
understood the logic of this method, now I got it, thank you. could post the reply describing this method?
– Jefferson Mello Olynyki
Add the instantiation of your $Pdo object I believe to be a few things in your preconfiguration but without this detail there is no way to be sure.
– LeonanCarvalho