Can i make this simpler?

afferogma

New Member
Hey,im new to PHP (started last week)ive got 10 lines of info in a SQLDBim doing the same thing to all 10:\[code\]$db_line1 = mysql_query("SELECT * FROM messages WHERE message_id='1'");$line1 = mysql_fetch_array($db_line1);unset ($line1['0']);unset ($line1['1']);unset ($line1['2']);$db_line2 = mysql_query("SELECT * FROM messages WHERE message_id='2'");$line2 = mysql_fetch_array($db_line2);unset ($line2['0']);unset ($line2['1']);unset ($line2['2']);\[/code\]Etc. etc. all the way to $line10, could i use something like the "foreach" function?
 
Back
Top