MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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();
|MySQL Sub-Select Query Returning Duplicate Result||7||46|
|Force PDF to open inline as opposed to dowload||16||25|
|How to eliminate "realname" and "email" from formMail.php (tectite.com) results.||3||38|
|PHP delete contents of file- before writing to it||6||27|