1
I have the following problem:
When performing a query, the while result is composed of more than one value, for example:
$query_sku = mysqli_query($connect, "SELECT t.column_name
FROM skus AS s
INNER JOIN table AS t ON t.column_id = s.column_id
WHERE s.id_sku = '{$id_sku}'");
WHILE($reg = mysqli_fetch_object($query_sku )){
$variable = $reg->column_name;
echo "<br/">;
}
The result of this query/while is:
BATERIA
PARA
CÂMERA
CANON
PowerShot ELPH 330 HS
And if I have it saved in the database, it will save a return per line:
When I really want him to come back that way:
BATERIA PARA CÂMERA CANON PowerShot ELPH 330 HS
And save to Database in only one line:
Thanks for the reply @João Martins, the problem is that when I do this, it returns me several times the answer: Powershot ELPH 330 HS BATTERY (RECHARGEABLE)Powershot ELPH 330 HS BATTERY (RECHARGEABLE) Camerapowershot ELPH 330 HS BATTERY (RECHARGEABLE) CAMERA CANON
– Rogério de Sá Jr.
The variable does not take all these values, only the last one. If you do
echo $variable
after the cycleWHILE
can confirm that the value is correct.– João Martins
So @Rogériodesájr., managed to solve the problem?
– João Martins