$result = mysql_query("SELECT * FROM rooms");
while($row = mysql_fetch_array($result))
{
mysql_query("insert into chat (name,text,date,chat_id) values('$_SESSION[username]','$_POST[text]','$date','$row[id]')");
}
can i do that without repeat the mysql_query code?