prepare('SELECT * FROM notes WHERE user_id = ? ORDER BY created_at DESC'); $stmt->execute([$_SESSION['user_id']]); $notes = $stmt->fetchAll(); } catch (PDOException $e) { // For now, just show an empty array on DB error $notes = []; } } else { // Sample Data for Notes for non-logged-in users $notes = [ [ 'title' => 'Biology Lesson Plan', 'content' => 'Introduction to cell theory. Discuss Hooke and Leeuwenhoek...', 'tags' => 'science,lesson-plan,10th-grade', 'color' => '#D4EDDA', ], [ 'title' => 'Student Study Notes - History', 'content' => 'Key dates for the American Revolution: 1765 Stamp Act, 1770 Boston Massacre...', 'tags' => 'history,student-notes,exam-prep', 'color' => '#F8D7DA', ], ]; } $note_created_success = isset($_GET['note_created']); ?>

Your Notes

Note created successfully!

You don't have any notes yet. Create your first one!