forked from edlcn/cs306db
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstores_select.php
More file actions
36 lines (26 loc) · 791 Bytes
/
stores_select.php
File metadata and controls
36 lines (26 loc) · 791 Bytes
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
27
28
29
30
31
32
33
34
35
36
<?php
include "config.php";
if (!empty($_GET["rid"])){
$rid = $_GET["rid"];
$sql_comment = "SELECT * FROM stores WHERE rec_id = '".$rid."' ";
if (!empty($_GET["eid"])){
$eid = $_GET["eid"];
$sql_comment .= " AND e_id = '".$eid."' ";
}
$myresult = mysqli_query($db,$sql_comment);
while($rows = mysqli_fetch_assoc($myresult)){
echo $rows["e_id"] . " - " . $rows["rec_id"] . "<br>";
}
}
else {
$sql_comment = "SELECT * FROM stores";
if (!empty($_GET["eid"])){
$eid = $_GET["eid"];
$sql_comment .= " WHERE e_id = '".$eid."' ";
}
$myresult = mysqli_query($db,$sql_comment);
while($rows = mysqli_fetch_assoc($myresult)){
echo $rows["e_id"] . " - " . $rows["rec_id"] . "<br>";
}
}
?>