Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- ProductName, ProductImages, ProductDescription,
- ProductPrice, ProductAddDate, cSchema_Name, cValueValue
- FROM
- Product p INNER JOIN CharacteristicsValue cv
- ON p.ID_product = cv.cValueProduct_FK
- INNER JOIN CharacteristicsSchema cs
- ON cv.cValueSchema_FK = cs.ID_cSchema
- WHERE
- ProductUrl = ?
- AND cv.cValueSchema_FK = cs.ID_cSchema
- AND cs.cSchema_Category_FK = p.ProductCategory_FK");
- "SELECT ProductName, ProductImages, ProductDescription,
- ProductPrice, ProductAddDate, ID_product, ProductCategory_FK
- FROM Product
- WHERE ProductUrl = ?"
- "SELECT cSchema_Name, cValueValue
- FROM CharacteristicsValue cv
- JOIN CharacteristicsSchema cs ON cv.ID_cValue = cs.ID_cSchema
- WHERE cv.cValueProduct_FK = ? AND cs.cSchema_Category_FK = ?"
- $stmt = $tmp_conn->prepare("SELECT ProductName, ProductImages, ProductDescription,
- ProductPrice, ProductAddDate, ID_product, ProductCategory_FK
- FROM Product
- WHERE ProductUrl = ?");
- $stmt->bind_param('s', $url);
- $stmt->execute();
- $result = $stmt->get_result();
- while ($row = $result->fetch_assoc()) {
- array_push($data, $row);
- }
- $result->free_result();
- $id_prod = $data[0]['ID_product'];
- $id_category = $data[0]['ProductCategory_FK'];
- $stmt = $tmp_conn->prepare("SELECT cSchema_Name, cValueValue
- FROM CharacteristicsValue cv
- INNER JOIN CharacteristicsSchema cs ON cv.ID_cValue = cs.ID_cSchema
- WHERE cv.cValueProduct_FK = ? AND cs.cSchema_Category_FK = ?");
- $stmt->bind_param('ii', $id_prod, $id_category);
- $stmt->execute();
- $result = $stmt->get_result();
- while ($row = $result->fetch_assoc()) {
- array_push($data, $row);
- }
- $result->free_result();
- SELECT
- ID_product, ProductName, ProductImages, ProductDescription,
- ProductPrice, ProductAddDate, cSchema_Name, cValueValue
- FROM
- Product p INNER JOIN CharacteristicsValue cv
- ON p.ID_product = cv.cValueProduct_FK
- INNER JOIN CharacteristicsSchema cs
- ON cv.cValueSchema_FK = cs.ID_cSchema
- WHERE
- ProductUrl = ?
- AND cv.cValueSchema_FK = cs.ID_cSchema
- AND cs.cSchema_Category_FK = p.ProductCategory_FK")
- GROUP BY `ID_product`;
Add Comment
Please, Sign In to add comment