first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

PHP 5.x Code: Building a SQL Format String for sprintf()

<?php
$sql = <<<BLOCK SELECT server.server_id , server.server_name , server.ip , server.mac , server.sn , server_status.status , notes FROM server , server_status WHERE server.status_id = server_status.status_id AND %1&bsol;&bsol;$s LIKE '%%%2\\$s%%' ; BLOCK;

$s = sprintf($sql,'ip','10.');

?>

mod date: 2006-10-05T22:32:20.000Z