Ok, this is a little complicated. Well, atleast to me it is.
I'm trying to make a user-defined menu. Where a registered user can choose what the menu should look like. As in, which components go where.
First, I defined the single menu elements. Such as,
function user_menu_1()
{
echo "bla";
}
function user_menu_2()
{
echo "sdfmsdaf";
}
function user_menu_3()
{
echo "this is module/component 3";
}
Now, what the selected are stored in a mysql database. Just the number of the menu.
Heres what the query looks like, basicly:
$user_menu_query = "SELECT user_menu1, user_menu2, user_menu3, user_menu4, user_menu5, user_menu6, user_menu7, user_menu8, user_menu9, user_menu10, user_menu11, user_menu12, user_menu13, user_menu14 FROM ".$user_menu_table." WHERE user_ID = '$user_ID' ";
$user_menu_result = mysql_query ($user_menu_query);
while ($menu_row = mysql_fetch_assoc ($user_menu_result)) {
user_menu1 would be the first menu to show. So, if user_menu1 would = 3. It should show user_menu_3();
How do I code this?
Is there an easier way than doing
if ($menu_row_1 = "1") {
echo user_menu_1();
}
if ($menu_row_1 = "2") {
echo user_menu_2();
}
?
🙁