fetch('SELECT id, phone_number FROM users LIMIT 1'); $userId = $user['id'] ?? null; $data = [ 'user_id' => $userId, 'type' => 'message', 'message' => 'Prueba: nuevo mensaje recibido', 'data' => json_encode(['phone' => $user['phone_number'] ?? '']), 'is_read' => 0, 'created_at' => date('Y-m-d H:i:s') ]; $id = $db->insert('notifications', $data); if ($id) { echo "Inserted notification id=$id for user_id={$userId}\n"; } else { echo "Failed to insert notification\n"; }