include conf php result mysql_query select from books where id id if r

 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?
include("../conf.php");
$result = mysql_query("select * from books where id=$id");
if ($result)
{
echo "ggggg";
exit;
}
else
{
echo mysql_affected_rows()."<br>";
echo mysql_error();
exit;
}
//list($id)=mysql_fetch_row($result);
if (isset($_POST["ok"])) {
{
$r = mysql_query("update `books`
SET
`name`='$name',
`sname`='$sname',
where id=$id");
if ($r)
{
header("Location: alfa.php");
exit;
}
else
echo "kjhgkjhgkjhgkj";
exit;
}
}
?>
<HTML>
<HEAD><TITLE>Administratsiya</TITLE>
</HEAD>
<BODY>
<CENTER>
<FORM action="edit.php?id=<?=$id?>" method="POST">
<table border=0>
<tr>
<td valign="top">
<TABLE border="0" cellspacing="1" cellpadding="3">
<TR>
<td bgcolor="#c2c2c2" colspan="2" align="center"><font face="arial" style="font:bold" color="#0033cc">Bazani o'zgartirishish</font></td>
</TR>
<tr>
<td class="chet">Inventar</td><td > <input type=text name=uid_book size=30 value="<?=$id?>" ><br></td>
</tr>
<tr>
<td class="chet">Reg data</td><td > <input type=text name=udata_reg_bk size=30 value="<?=$data_reg_bk?>" ><br></td>
</tr>
<tr>
<td class="chet">Nomi</td><td > <input type=text name=uname size=30 value="<?=$name?>" ><br></td>
</tr>
<tr>
<td class="chet">Yo'nalish</td><td > <input type=text name=udirection size=30 value="<?=$direction?>"><br></td>
</tr>
<tr>
<td class="chet">Avtor</td><td > <input type=text name=uauthor size=30 value="<?=$author?>" ><br></td>
</tr>
<tr>
<td class="chet">Nashriyot</td><td > <input type=text name=upublish size=30 value="<?=$publish?>" ><br></td>
</tr>
<tr>
<td class="chet">Kategoriya</td><td > <input type=text name=ucat_id_bk size=30 value="<?=$cat_id_bk?>" ><br></td>
</tr>
<tr>
<td class="chet">Shahar</td><td > <input type=text name=ucityname size=30 value="<?=$cityname?>" ><br></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="ok" value="Tasdiqlash"></td>
</tr>
</table>
</CENTER>
</BODY>
</HTML>