I'm trying to assign the results of a query to an array:
$sql_keywords = "SELECT keyword FROM keywords WHERE article = '$articleID';
$result_keywords=mysql_query($sql_keywords);
$i=1;
while ($query_keywords = mysql_fetch_array($result_keywords))
{
$keyword_arr[$i]=$query_keywords['keyword'];
echo $keyword_arr[$i]."<br>";
$i=$i+1;
}
I've checked the resulting query data and it's fine. (The words in $query_keywords['keyword'] are "red", "blue" and "green". I've echoed to check - and it's OK.)
However, when I run the above code I'm only seeing the first letter of my words, i.e.
r
b
g
What am I doing wrong?
Any pointers greatly appreciated.
Thanks.