1
I have a table where the structure is as follows:
Idestoques | Idprodutos | Tamanho | Cores | Estoques
In it storing the sizes, colors and stocks of each product. However I need to bring from the database the following information:
Tamanhos: P,M, G
Cores: Azul, Amarelo, Vermelho
I managed to bring only the sizes as follows:
$sqlEstoques = mysqli_query($this->conexao,"SELECT * FROM loja_estoques WHERE IDProdutos = '".$jmBusca->IDProdutos."';");
if(mysqli_num_rows($sqlEstoques) > 0){
$resultado = array();
while($jmEstoques = mysqli_fetch_array($sqlEstoques)){
$resultado[] = $jmEstoques["Tamanho"];
}
$visualizar .= "<div class='col-lg-12' style='font-size: 14px; text-align: left'><strong>Tamanhos:</strong>". implode(",",$resultado);
$visualizar .= "</div>";
}
Saída: Tamanho: P,M,G
How would I bring the colors too?
Cores: Azul, Amarelo, Vermelho
The same way you did with the sizes, saving them in an array and then implode. Some difficulty you found and did not put in the question? You can [Dit] to be clearer :)
– gmsantos
Hello gmsantos. Sorry, I could not understand very well. Could you give me an example?
– user24136
barter
$jmEstoques["Tamanho"];
color.– gmsantos
Right. I’ve already done this, but I couldn’t figure out how to save in an array and then play to an implode to get the size and colors coming from the comic. I have to create 02 querys and 02 ties?
– user24136
itere a fez, save two variables.
– gmsantos
Sorry gmsantos, I really couldn’t understand it. It would be like to give me an example based on my code?
– user24136