Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ('config.php');
- $queryResult = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM products WHERE pid=1"));
- $cid = $queryResult['cid'];
- $pid = $queryResult['pid'];
- $query = mysqli_query($link, "SELECT cid,fields_name FROM `pattern_fields` WHERE cid=$cid");
- while($fields = mysqli_fetch_assoc($query))
- {
- $var = $fields['fields_name'];
- $array = explode(',', $var);
- foreach ($array as &$value)
- {
- $query = mysqli_query($link, "SELECT $var FROM `products_fields` WHERE pid=$pid");
- while($row = mysqli_fetch_assoc($query))
- {
- echo $products_fields[$value].' = '.$row[$value].'</br>';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment