Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SQL查询:SELECT sum(value) as valuee FROM table_name WHERE id = $id_session AND year = $year
SELECT sum(value) as valuee FROM table_name WHERE id = $id_session AND year = $year
这个查询什么也没给我。
但如果我这样做:
SELECT sum(value) as valuee FROM table_name - 在没有 WHERE 子句的情况下工作。
SELECT sum(value) as valuee FROM table_name
您可能没有正确设置$id_session或$year。试试这个:
$id_session
$year
$sql = "SELECT sum(value) as valuee FROM table_name WHERE id = '$id_session' AND year = '$year'"; echo $sql;
编辑
为了节省未来的访问者一些时间,这是 OP 在评论中发布的最终结果:
i had the wrong table name phpmyadmin. Now it is fine