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.
我有一个非常复杂的 PHP 函数,用 SQL 重写需要很长时间。所以我想知道是否有可能做这样的事情。
例如:
$query = "SELECT p.id FROM pages p WHERE check_access(p.id) = 1" mysql_query($query); ...
check_access 将是 PHP 函数。
这是不可能的,因为 SQL 解释与 PHP 解释是分开进行的。
您只能在 SQL 查询中使用 php 函数的输出。