forked from VovaGurovskiy/EnergoRemote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getuser.php
43 lines (41 loc) · 927 Bytes
/
getuser.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?
include("bd.php");
$id_user = trim(htmlspecialchars(stripslashes($_GET['id_user'])));
if ($id_user!='')
{
$sql = "SELECT * FROM user WHERE id_user='$id_user'";
$result = mysql_query($sql,$db);
/*$myrow = mysql_fetch_array($result);
if (!empty($myrow['id_user']))
{
echo $myrow['id_user'].'<br>';
echo $myrow['login'].'<br>';
echo $myrow['pass'].'<br>';
echo $myrow['name_user'];
}*/
} else
{
$sql = "SELECT * FROM user";
$result = mysql_query($sql,$db);
/*while($myrow = mysql_fetch_array($result))
{
echo $myrow['id_user'].'<br>';
echo $myrow['login'].'<br>';
echo $myrow['pass'].'<br>';
echo $myrow['name_user'].'<br>';
}*/
}
function getuserinfo($id_user)
{
if ($id_user!='')
{
$sql = "SELECT * FROM user WHERE id_user='$id_user'";
$result = mysql_query($sql,$db);
} else
{
$sql = "SELECT * FROM user";
$result = mysql_query($sql,$db);
}
return $result;
}
?>