2
I have the following scenario, I perform a query to the bank and return all 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++;
?>
Then I need to print a table with the academic number and points,
<td align="center"><?php echo $row[0];?></td>
<td align="center"><?php echo $row[1];?></td>
Until then ok, the point is that I needed to get the values of
$row[0]
And move to another variable, which will be used to consult 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, someone has an idea of how to do this?
$user2->value = $_POST["username"];
This variable you need to load, is in another php file?
– Luis Henrique
@Luishenrique in the same file.
– haykou
What’s in the
var_dump()
of$row[0]
?– Erlon Charles
Why can’t you do it
$user1->value = $row[0];
?– Luis Henrique
@Luishenrique, forgive me for being layman in the language, I did the same thing but had put in quotes, now without working out, very grateful.
– haykou
No problem. I put an answer with this, I thought there was some reason not to assign direct.
– Luis Henrique