October 6, 200917 yr I want to come up with something I think is a variable variable, but it doesn't seem to be working. This is what I'd like... $wk11 = "`week_one`"; $wk11 = "`week_two`"; $wk11 = "`week_three`"; $wk21 = "`week_four`"; $wk21 = "`week_five`"; $wk21 = "`week_six`"; $num ="1"; $result = mysql_query("select $wk{$num}1, $wk{$num}2, $wk{$num}3 from `diary_table`"); // query and result used here then afterwards... $num ++ $result = mysql_query("select $wk{$num}1, $wk{$num}2, $wk{$num}3 from `diary_table`");
October 6, 200917 yr You're looking for an array. $wk11 = array("week_one","week_two","week_three"); You would call the results with $wk11[0],$wk11[1],$wk11[2] etc. PHP Arrays
Create an account or sign in to comment