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 语句调用 php define()。
define("GET_LAST_DATE", " SELECT o.`order_date` FROM autoship_order a, orders o WHERE a.last_order_id = o.order_id AND a.autoship_order = ? ");
为了在其他页面上引用定义,您需要执行include_once定义文件。
include_once
include_once "definition.php";
要CONSTANT在 mysqli 查询中使用,请执行以下操作。
CONSTANT
$stmt = $mysqli->prepare(GET_LAST_DATE); $stmt->bind_param("i", 1);