When I query, the result is composed of more than one value (WHILE/LOOP), 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
When I save the values in the database, the values are saved in different rows.
But, I want you to save in a single row:
BATERIA PARA CÂMERA CANON PowerShot ELPH 330 HS
How can I do this? Thanks!
I already tried to do this:
while($reg = mysqli_fetch_object($query_sku ))
$variable .= " ".$reg->column_name;
But, the result is a repetition of same values:
PowerShot ELPH 330 HS BATTERY (RECHARGEABLE)PowerShot ELPH 330 HS BATTERY (RECHARGEABLE) CAMERAPowerShot ELPH 330 HS BATTERY (RECHARGEABLE) CAMERA CANON