0
$buscar = 'test string';
$stmt = $conexion->prepare("SELECT * FROM carpas WHERE MATCH(marca,modelo) against(?) LIMIT 10;");
$stmt->bind_param("s", $buscar);
$stmt->execute();
$result = $stmt->get_result();
print_r($result);

Php script gets me no results, but if I open phpmyadmin and input SELECT * FROM carpas WHERE MATCH(marca,modelo) against('test string') LIMIT 10 It get results. I think the binding might have problems, but dont know whats wrong

Ricardo Mehr
  • 310
  • 1
  • 3
  • 12
  • 2
    What is the output of `print_r($result);`? I would think that output is completely useless as it will show all properties of this class as NULL, correct? How did you verify that the query returned no rows? – Dharman Jan 02 '22 at 23:12
  • @Dharman It prints nothing, I just tried `if (mysqli_num_rows($result) > 0) {echo 'works';}` and it throws an error since the result is boolean. – Ricardo Mehr Jan 02 '22 at 23:18
  • 1
    Then that's a completely different thing, isn't it? It means that you forgot to enable mysqli error reporting. It would help if you actually put more details into this question. Tell us what is the output and what debugging you have done. But first make sure you have error reporting enabled. – Dharman Jan 02 '22 at 23:18
  • @Dharman I´ll update once done. – Ricardo Mehr Jan 02 '22 at 23:25

0 Answers0