I am trying to echo out my database results out as an array. currently now this is what I get
great, blue but I need it to be setup like this array('great', 'blue')
How do I echo my result out like this?
$oldWord = array('good', 'green');
foreach ($oldWord as $key => $value)
{
$sql = "select * from `words` where `name` = '" . $value . "'";
$res = mysql_query($sql);
while ($row = mysql_fetch_assoc($res)) {
echo $row["SYNONYM1"] .", ";
}
}
great, blue but I need it to be setup like this array('great', 'blue')
How do I echo my result out like this?
$oldWord = array('good', 'green');
foreach ($oldWord as $key => $value)
{
$sql = "select * from `words` where `name` = '" . $value . "'";
$res = mysql_query($sql);
while ($row = mysql_fetch_assoc($res)) {
echo $row["SYNONYM1"] .", ";
}
}