Bank query for another variable

2

I have the following scenario, I make a query to the database and return all the data:

<?php
include ("conectar.php");
$query = "SELECT * FROM pontos ORDER by pontos DESC LIMIT 0,10";

if ($result = mysqli_query($link, $query)) {

    $lista = 0;
    while ($row = mysqli_fetch_row($result)) {

        $lista++;
?>

So I need to print a table with the academic number and the points,

        <td align="center"><?php echo $row[0];?></td>
        <td align="center"><?php echo $row[1];?></td> 

So far, okay, the point is I needed to get the values from

$row[0]

And move to another variable, which will be used to query a webservice.

$user1->value = 'row[0]';

I can only pass a value from an input, and I needed the values to come directly from the first column of the bank, does anyone have any idea how to do this?

$user2->value = $_POST["username"];
    
asked by anonymous 20.05.2015 / 19:51

1 answer

1

Just assign the value directly to the desired variable during the loop.

<?php
include ("conectar.php");
$query = "SELECT * FROM pontos ORDER by pontos DESC LIMIT 0,10";

if ($result = mysqli_query($link, $query)) {

    $lista = 0;
    while ($row = mysqli_fetch_row($result)) {
        $user1->value = $row[0];
        $lista++;
?>
    
20.05.2015 / 20:01