-5
Well in this case, my question is this, I select the database with the criteria I want you to have. How can I then do a while to show these results, which were fetched from the database.
Thank you.
-5
Well in this case, my question is this, I select the database with the criteria I want you to have. How can I then do a while to show these results, which were fetched from the database.
Thank you.
1
Would that be?
$query = "SELECT...";
$sql = mysqli_query($conexao, $query);
while($dado = mysql_fetch_array($sql)){ // Enquanto houver dados ficará em loop
$a = $dado['coluna1']; //recupera o dado do array
$b = $dado['coluna2'];
echo $a."-".$b."<br><br>"; //exibe o dado
}
By the way, what is mysql_fetch Assoc for?
@Gonçalo o fetch_assoc()
, does the same thing as fetch_array()
, the difference is that with the fetch_array()
you can indicate the index of the query by the name of the database column or by the index number of the array, already the fetch_assoc()
, is by column name only. Note that these functions are obsolete in PHP 7.
Tell me what the $variable given in the while parameter means
$dado
is an array, it will receive the rows of your database table, every loop of the while
she gets a new line
-1
Your question is very comprehensive, first search how it works to fetch the data, follow a referral link:
http://pt-br.html.net/tutorials/php/lesson20.php
So in case you have any questions post here.
Hug
Friend I know how to use the mysql fetch array functionality, I just don’t know how to show all the data of this select, because for example if I do a select Where ages="25", there may be various ages with 25 years and I want to show the data of these people all with ages equal to 25 years.
For what SELECT wants is set select where idades="25"
, I don’t understand
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
Put in the code you have
– rray
I think it will be necessary while. Post the code you have already developed.
– Krismorte
It depends on what your search code looks like. The only way to respond is by putting your code in.
– Math