我的php脚本有时会给我以下错误:
=Switch( Fields!Customerid.value= 1,"1000", Fields!Customerid.value= 2,"2000", Fields!Customerid.value= 3,"3000", Fields!Customerid.value= 4,"4000", Fields!RCustomerid.value= 5,"5000", Fields!Customerid.value= 6,"6000", Fields!Customerid.value= 7,"7000", Fields!Customerid.value= 8,"8000", Fields!Customerid.value= 9,"9000", Fields!Customerid.value= 10,"10000",Fields!Customerid.value<>1 or Fields!Customerid.value<>2 or Fields!Customerid.value<>3 or Fields!Customerid.value<>4 or Fields!Customerid.value<>5 or Fields!Customerid.value<>6 or Fields!Customerid.value<>7 or Fields!Customerid.value<>8 or Fields!Customerid.value<>9 or Fields!Customerid.value<>10,SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))
verifica.php第10行:
Warning: session_start(): Session callback expects true/false return
value in C:\xampp\htdocs\verifica.php on line 10
有什么不对?为什么我有这个错误?这只会在需要时显示,而不是总是......
答案 0 :(得分:3)
当代码使用session_set_save_handler和对象时,我遇到同样的问题,我通过从_destroy方法返回布尔值来解决问题,我认为所有处理程序都需要返回true / false。
答案 1 :(得分:1)
我认为最好这样做:
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
不同的价值观:
PHP_SESSION_DISABLED = 0
PHP_SESSION_NONE = 1
PHP_SESSION_ACTIVE = 2
你还有同样的错误吗?