K
K
kuzyairon2020-05-30 14:33:57
PHP
kuzyairon, 2020-05-30 14:33:57

How to add specific value from Mysql (Redbeanphp) table to URL?

The crux of the matter is as follows.
There is a table with columns id, token, login, join_date, expire_date

Authorization takes place with the login value and from this value it is necessary to pull up the token value in the URL

That is, to get site.ru/login.php?token=hash I

broke my whole head how to pull up this value, and if it pulls up, then the whole array, but I don’t need it or pulls up the zero value

UPD:

if($sevendays == false ) {

        $data = $_POST;
        $activesevendouble =  R::findone('activen', 'login = ? ', array($data['login']));
     
        echo $activesevendouble;

        echo '<div style="color: green;">Ну все SEVENDAYs </div>';
        $urrll = "http://example.com/activate.php?token=$activesevendouble";
        echo $urrll;


This is how it pulls up the full value of the array. How to pull out exactly "token" from it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kuzyairon, 2020-05-30
@kuzyairon

I solved this problem myself with this expression:

$activesevendouble = R::getCell('SELECT `token` FROM activen WHERE `login` = ? LIMIT 1', [$data]);

He asked himself, answered himself, the best method of knowing this world))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question