MySQLi recordset not returning correct values
I have a search form on one page, and the results on another page.
This is my form:
<form action="ocodeSearch.php" method="post">
Search by OCODE <input name="ocode" type="text" id="ocode" size="15">
<input name="submit" type="submit" id="submit" value="Search">
</form>
This is the query on the results page:
<?php require_once('Connections/nelson.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$strQuery = new WA_MySQLi_RS("strQuery",$nelson,1);
$strQuery->setQuery("SELECT * FROM nelsonoc WHERE ocode LIKE ?");
$strQuery->bindParam("s", "".(isset($_POST['ocode'])?$_POST['ocode']:"") ."", "-1"); //colname
$strQuery->execute();?>
<p>Total records: <?php echo $strQuery->TotalRows ?> </p> No matter what I enter in the search field, it always returns a record count of 0. I'm also getting an error when I create the recordset (see screen print).
ocode is a varchar field. Please see attached screen prints. Hopefully, you can tell me why it's not working.
Thank you.


