PHP echo array. Help needed?

Stacey

New member
I have a php code that find and replace. if I echo out my result from the database I get what I want but I need to get the information in an array format. like this array('good','blue') How do I make the information from the database echo out in an array

$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"] . " ";

}

}
 
Back
Top