this is really hard for me, i\'m trying to store multiple rows from my table in mysql into a single variable
$mysql_statementJc = \"SELECT * FROM `dog`.`ca
you want to create a concatenated string, php has the .=
syntax for this:
$groupConcat='';
while($row = mysql_fetch_array($mysql_commandJc)){
$groupConcat .= $row['industry'] . " OR ";
}
echo $groupConcat; //no point echoing inside the loop
sometimes a better approach is to use an array and implode()
$groupConcat=array();
while($row = mysql_fetch_array($mysql_commandJc)){
$groupConcat[] = $row['industry'];
}
echo implode(' OR ',$groupConcat);