Guest User

Untitled

a guest
Feb 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. source mySource{
  2. type = mysql
  3. sql_host = localhost
  4. sql_user = root
  5. sql_pass = mypass
  6. sql_db = test
  7. sql_query = SELECT id, uname FROM users
  8. sql_attr_uint = id
  9. sql_attr_string = uname
  10. sql_port = 3306
  11. }
  12.  
  13. index test{
  14. source = mySource
  15. path = /var/lib/sphinxsearch/data
  16. docinfo = extern
  17. }
  18. searchd{
  19. listen = 9306:mysql41
  20. log = /var/log/sphinxsearch/searchd.log
  21. query_log = /var/log/sphinxsearch/query.log
  22. read_timeout = 5
  23. pid_file = /var/run/sphinxsearch/searchd.pid
  24. seamless_rotate = 1
  25. preopen_indexes = 1
  26. unlink_old = 1
  27. binlog_path = /var/lib/sphinxsearch/data
  28. }
  29.  
  30. <?php
  31. $conn = new mysqli('localhost','root','mypass','test',9306);
  32.  
  33. if($conn->connect_error){
  34. die("Could not connect");
  35. }else{
  36. echo "You are connected!";
  37. }
  38.  
  39. $query = $conn->query("SELECT * FROM test WHERE MATCH('hsmith')");
  40. echo $query->error;
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment