Hi I am new to php and I am facing difficulties with named parameter. I am learning form "Murach's php and sql book" Here is the code in my question,
$query = 'SELECT productCode, productName, listPrice
FROM products
WHERE productID = :product_id';
$statement = $db->prepare($query);
$statement->bindValue(':product_id', $product_id);
$statement->execute();
$product = $statement->fetch();
$statement->closeCursor();
So all my confusion is around "WHERE productID = :product_id';" What does this means ? I dont understand this. Usually we make condition there like WHERE productID < 100 or something like that. So it gives all the productIDs with value less than 100 right? Then how this works here ? i mean I did not see that this named parameter has been assigned with any values anywhere else. This is an example from the book. Or is that in real program we assign values to the named parameter variable so that it will provide appropriate result? Please help me and excuse me if it sounds so foolish because I am totally new to this.