What is the best way to go about this, I feel like Im doing it all wrong with an if statement that takes up a generous amount of space.
Know what I mean?PHP Code:$sql = "SELECT * FROM notes";
$result = mysql_query($sql);
while ($query = mysql_fetch_array($result)) {
$list[] = $query;
}
for ($i = 0; $i < count($list); $i++) {
if ($list[$i] == '1') {$list[$i] == 'Name'}
if ($list[$i] == '2') {$list[$i] == 'Note'}
if ($list[$i] == '3') {$list[$i] == 'Etc'}
}
Can i do like a case/switch would that be better?
Or maybe compare two arrays? array(1\,2,3,4,5) and array(name, note, etc etc etc)
orr is there like a reference variable? $$list[$i]





Bookmarks