Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.
I know for a fact the result set returned should be 2 records, but somehow I keep getting zero records. Can anyone look at my code and tell me what I'm doing wrong?
$categoryID = 1; $productCode = 's%'; $db = new PDO('mysql:host=localhost;dbname=my_database', 'username', 'password'); $stmt = $db->prepare("SELECT * FROM products WHERE categoryID = :categoryID, AND productCode like :productCode"); $stmt->bindParam(':categoryID', $categoryID, PDO::PARAM_INT); $stmt->bindParam(':productCode', $productCode, PDO::PARAM_STR); $stmt->execute(); $results = $stmt->fetchAll(); echo '-->Number of Records: '.count($results).'<p />'; $stmt->closeCursor();
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.