Help with array
Posted: Sat May 16, 2009 5:39 pm
Is there any way to use the keys that i want in a keyed array?
I'm doing this but it gives me an error
I'm doing this but it gives me an error
Code: Select all
$result = db_query('SELECT * FROM {team}');
$rows = array();
while ($team = db_fetch_object($result)) {
array_push($rows, $team);
}
$check = array();
foreach($rows as $team)
{
$id = $team->team_id;
$name = $team->name;
array_push($check, $id => t($name));
}