MySQLi Recordset using Contains & data submitted via a form
The below is my SQL created by the behaviors panel. I have a form field called "search" which posts to the page containing the below. No results are found yet using the test button while building the query works and displays data. I have checked that the form is posting to the page and can catch and print the form field. Any help would be super as Im going mad looking at this
<?php
$latestnews = new WA_MySQLi_RS("latestnews",$mysqli,1);
$latestnews->setQuery("SELECT * FROM news WHERE title LIKE ?");
$latestnews->bindParam("s", "".(isset($_POST['searchtxt'])?$_POST['searchtxt']:"") ."", "-1"); //colname
$latestnews->execute();
?>
I solved this by changing the s to a c
$latestnews->bindParam("c", "".(isset($_POST['searchtxt'])?$_POST['searchtxt']:"") ."", "-1"); //colname