GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing foolcode.github.io — Configuration - SphinxQL Query Builder Documentation Configuration¶Driver Setup¶MySQLi driver: <?php use Foolz\SphinxQL\Drivers\Mysqli\Connection; $conn = new Connection(); $conn->setParams([ 'host' => '127.0.0.1', 'port' => 9306, 'options' => [ MYSQLI_OPT_CONNECT_TIMEOUT => 2, ], ]); PDO driver: <?php use Foolz\SphinxQL\Drivers\Pdo\Connection; $conn = new Connection(); $conn->setParams([ 'host' => '127.0.0.1', 'port' => 9306, 'charset' => 'utf8', ]); Connection Parameters¶
Notes:
Escaping and Quoting¶Value escaping and quoting are connection-driven. <?php $quotedText = $conn->quote('hello'); // 'hello' $quotedInt = $conn->quote(42); // 42 $quotedNull = $conn->quote(null); // null $quotedList = $conn->quote([1, 2, 3]); // (1,2,3) For raw SQL fragments, use <?php use Foolz\SphinxQL\SphinxQL; $sql = (new SphinxQL($conn)) ->select() ->from('rt') ->option('field_weights', SphinxQL::expr('(title=80, content=35)')) ->compile() ->getCompiled(); // SELECT * FROM rt OPTION field_weights = (title=80, content=35) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |