-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.php
26 lines (25 loc) · 979 Bytes
/
Item.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
session_start();
require_once './inc/config.inc';
$sql='select * from products';
if (isset($_REQUEST['itemID'])){$itemID=$_REQUEST['itemID'];}// else die("Some kind an error accured");
$sql.=" where id=?";
$conn=Con();
$stmt=$conn->prepare($sql);
$stmt->bind_param(i, $itemID);
$stmt->execute();
$res=$stmt->store_result();
$j=$stmt->affected_rows;
if ($j===0) die("Something was worng on your way here");
$stmt->bind_result($row['id'],$row['cat_id'],$row['scat_id'],$row['producerId'],$row['prodName'],$row['price']);
echo ('<table align=center>');
while ($stmt->fetch()){
echo "<tr><td>$row[id]</td>".
"<td><image src='img/moz4.jpg' style='height:192px;width:256px;' /></td>".
"<td>$row[cat_id]</td>".
"<td>$row[scat_id]</td>".
"<td>$row[producerId]</td>".
"<td>$row[prodName]</td>".
"<td>$row[price]</td></tr>";
}
echo "</table>";