T
T
timonestudio2021-08-26 08:57:31
PHP
timonestudio, 2021-08-26 08:57:31

RedBeanPHP how to get decimal value in PhpMyAdmin balance table and display via tag?

Code that doesn't work:

$bal =  R::load('balance', 'id = ?');
<p><?php echo $bal ?> </p>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
infinityfreenom, 2021-08-26
@timonestudio

<?php
$id = 1;
$bal = R::findOne('balance', 'id = ?', [$id]); // R::load('balance', $id);
?>
<p><?= $bal->decimal /* если decimal - это столбец такой конечно, а не тип столбца */ ?></p>
<?php
$bal = $bal->export(); // если нужен массив
?>
<p><?= $bal['decimal'] /* если decimal - это столбец такой конечно, а не тип столбца */ ?></p>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question