SHOW:
|
|
- or go back to the newest paste.
| 1 | <?php | |
| 2 | require_once ('config.php');
| |
| 3 | ||
| 4 | $queryResult = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM products WHERE pid=1")); | |
| 5 | ||
| 6 | $cid = $queryResult['cid']; | |
| 7 | $pid = $queryResult['pid']; | |
| 8 | $query = mysqli_query($link, "SELECT * FROM `products_fields` WHERE pid=$pid"); | |
| 9 | - | |
| 9 | + | $row = mysqli_fetch_assoc($query); |
| 10 | - | $query = mysqli_query($link, "SELECT cid,fields_name FROM `pattern_fields` WHERE cid=$cid"); |
| 10 | + | foreach($row as $field => $value) |
| 11 | - | while($fields = mysqli_fetch_assoc($query)) |
| 11 | + | |
| 12 | - | {
|
| 12 | + | echo $field.' = '.$value.'</br>'; |
| 13 | - | $var = $fields['fields_name']; |
| 13 | + | |
| 14 | - | $array = explode(',', $var);
|
| 14 | + | |
| 15 | - | foreach ($array as &$value) |
| 15 | + |