I am querying a database and need to pull back some values and store them in the into an array so it looks like this:
This is what I have but it doesn't seem to be pulling the values in:
Can anyone point me in the right direction?
Code:
$data = array(25,0,7,6,15,4,3,22,1);
This is what I have but it doesn't seem to be pulling the values in:
Code:
$query = "SELECT * FROM items";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$data[] = $row['id'];
}
Can anyone point me in the right direction?