[insert_php]

$id_nr= mysql_connect(”mysql2.space2u.com”, ”d15181-aif”, ”bTuLbrz2p”);
mysql_select_db(”d15181_wp2”,$id_nr);

$year = date(”y”);
$week = date(”W”);

$week = $week + 1;

$vecka1= $year . $week . ”1”;

$vecka2= $year . $week . ”2”;

$vecka3= $year . $week . ”3”;

$vecka4= $year . $week . ”4”;

$vecka5= $year . $week . ”5”;

$vecka6= $year . $week . ”6”;

$vecka7= $year . $week . ”7”;

$vecka8= $year . $week . ”8”;

$vecka9= $year . $week . ”9”;

$sqlfraga = ”SELECT * FROM `ambj_meny` WHERE dag=$vecka1 or dag=$vecka2 or dag=$vecka3 or dag=$vecka4 or dag=$vecka5 or dag=$vecka6 or dag=$vecka7 or dag=$vecka8 or dag=$vecka9”;

$data=mysql_query($sqlfraga);
$i=1;
while($raden = mysql_fetch_row($data))
{
$meny[$i] = $raden[2];
$i++;
}

$sqlfraga=(”SELECT * from ambj_mat order by id asc”);
$data=mysql_query($sqlfraga);
$i=0;
while($raden = mysql_fetch_row($data))
{
$mat[$i] = $raden[1];
$i++;
}

echo ”Vecka: ” . $week;

[/insert_php]

 

Måndag:

[insert_php]echo utf8_encode($mat[$meny[1]]);[/insert_php]

Tisdag:

[insert_php]echo utf8_encode($mat[$meny[2]]);[/insert_php]

Onsdag:

[insert_php]echo utf8_encode($mat[$meny[3]]);[/insert_php]

Torsdag:

[insert_php]echo utf8_encode($mat[$meny[4]]);[/insert_php]

Fredag:

[insert_php]echo utf8_encode($mat[$meny[5]]);[/insert_php]

Lördag:

[insert_php]echo utf8_encode($mat[$meny[8]]);[/insert_php]

Söndag:

[insert_php]echo utf8_encode($mat[$meny[9]]);[/insert_php]

Veckans alternativ:

[insert_php]echo utf8_encode($mat[$meny[6]]);[/insert_php]