Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Query test fails #194

Open
yazer79 opened this issue Dec 10, 2020 · 1 comment
Open

Basic Query test fails #194

yazer79 opened this issue Dec 10, 2020 · 1 comment

Comments

@yazer79
Copy link

yazer79 commented Dec 10, 2020

Hi,
I am using composer installation of "foolz/sphinxql-query-builder" and a sphinx index with test result. I am trying to use this simple test php script, but I get an error:
"Fatal error: Uncaught Error: Call to undefined method Foolz\SphinxQL\SphinxQL::create()"
Any suggestions?
Windows 10 - composer 2 - PHP 7.1 - sphinxsearch 3.1.1

require_once __DIR__ ."/../vendor/autoload.php";

use Foolz\SphinxQL\SphinxQL;
use Foolz\SphinxQL\Drivers\Mysqli\Connection;
 
$conn = new Connection();
$conn->setParams(array('host' => 'localhost', 'port' => 9306));

$query = SphinxQL::create($conn)
->select('*')
->from('test_index')
->match('test');

$result = $query->execute();
$results = $result->fetchAllAssoc();
print_r($results);
@dmayzhanov
Copy link

You need to create a new instance of SphinxQL.

$query = (new SphinxQL($conn))->select('*')
->from('test_index')
->match('', 'test');

$result = $query->execute();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants