Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = '192.168.88.116';
- $database = 'goods';
- $user = 'root';
- $password = '';
- $link = mysql_connect($host, $user, $password) or die("Ошибка " . mysqli_error($link));
- $bdlink = mysql_select_db($database,$link);
- $res = mysql_query("SELECT COUNT(*) FROM `case`");
- $row = mysql_fetch_row($res);
- $total = $row[0];
- $sql = "SELECT * FROM `case` ORDER BY id LIMIT 0, $total"; //формируем список меню по id
- $result = mysql_query($sql);
- $i=1;
- echo "<table class='table'>
- <thead>
- <tr>
- <th scope='col'>id</th>
- <th scope='col'>Наименование</th>
- <th scope='col'>Производитель</th>
- <th scope='col'>Код производителя</th>
- <th scope='col'>Типоразмер</th>
- <th scope='col'>Форм-фактор</th>
- <th scope='col'>Блок питания</th>
- <th scope='col'>Материал корпуса</th>
- <th scope='col'>Конструкция</th>
- <th scope='col'>Цена</th>
- <th scope='col'>Купить</th>
- </tr>
- </thead>
- <tbody>";
- while($stat = mysql_fetch_array($result)) //выводим меню пока есть строки
- // mysql_close($link);
- {
- echo "<tr>";
- echo "<th scope='row'>$stat[id]</th><td>$stat[name]</td><td>$stat[manufacturer]</td><td>$stat[code_manufacturer]</td><td>$stat[typesize]</td><td>$stat[form_factor]</td><td>$stat[powersupply]</td><td>$stat[material]</td><td>$stat[contruction]</td><td>$stat[price]</td><td><a href='cart.php?name=$stat[name] & price=$stat[price]'><img src='img/cart2.png' width='50' height='50'></a></td>";
- echo "</tr>";
- }
- echo " </tbody>
- </table>
- ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement