I have a basic table where I am trying to retrieve records that are filtered by a form request. Here is the code I have...
$ps = $pdo->prepare("SELECT * FROM `Products` Where `Vendor` LIKE '%?%'");
$ps->execute(array($_POST['Vendor']));;
echo "post=" . $_POST['vendor']; ////Displays correct data from form request
$count = $ps->rowCount();
echo "Count=" . $count; ////Count = 0 although I know for a fact that there is 1 record that should be in there
////Used for display of records
foreach ($ps as $row){
echo $row, PHP_EOL . "xxx<br>";
}
Where is the incorrect code? I am new to php and pdo. Thank you in advance
K
$ps = $pdo->prepare("SELECT * FROM `Products` Where `Vendor` LIKE '%?%'");
$ps->execute(array($_POST['Vendor']));;
echo "post=" . $_POST['vendor']; ////Displays correct data from form request
$count = $ps->rowCount();
echo "Count=" . $count; ////Count = 0 although I know for a fact that there is 1 record that should be in there
////Used for display of records
foreach ($ps as $row){
echo $row, PHP_EOL . "xxx<br>";
}
Where is the incorrect code? I am new to php and pdo. Thank you in advance
K