php - How to call define() with SQL statement with input parameters -


hey how call php define() sql statement has input parameters php page.

      define("get_last_date", "          select o.`order_date`          autoship_order a, orders o          a.last_order_id = o.order_id      , a.autoship_order = ?              "); 

in order have definition reference across other pages need include_once definition file.

include_once "definition.php"; 

to use constant in mysqli query perform following action.

$stmt = $mysqli->prepare(get_last_date); $stmt->bind_param("i", 1); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

asp.net - Configuring WCF Services in Code WCF 4.5 -