I am working on a PHP system that shows the schedule of students. I have a database and a table in a PHP file in Dreamweaver, all connected. However, i get stuck when i want to show the next day of the schedule. There is a table column in MySQL called 'day', with a value of 1 to 5 for monday to friday.

In the beginning of the Dreamweaver code, i added this:

    session_start();
       if (!isset($_SESSION["currentday"])){
           $_SESSION["currentday"] = 1;
       }

I added two arrows to the PHP page to go to the next or previous day. However, the database doesn't seem to recognise the session variable. Part of the query is:

... AND lesson.day='$currentday'

When I run the page, this is the result: *Notice: Undefined variable: currentday in E:*

有帮助吗?

解决方案

U must first add $currentday=$_SESSION['currentday']

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top