-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload.php
41 lines (40 loc) · 1021 Bytes
/
load.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
<?php
if($_SERVER['REQUEST_METHOD']=="POST")
{
session_start();
$_SESSION['table_name']=$_POST['table'];
$table=$_POST['table'];
$con=mysql_connect("localhost","root","");
mysql_select_db("poshakh",$con);
echo "<html>";
echo "<body>";
echo "<table border=1 style='margin-left:200px; margin-top:50px'>";
echo "<tr>";
$result = mysql_query("select * from ".$table,$con);
$no_c=mysql_num_fields($result);
$i=0;
for($i=0;$i<$no_c;$i++)
{
echo "<th>".mysql_field_name($result,$i)."</th>";
}
echo "</tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr>";
for($i=0;$i<$no_c;$i++)
{
$f_name=mysql_field_name($result,$i);
echo "<td>".$row[$f_name]."</td>";
}
$ID=mysql_field_name($result,0);
echo "</tr>";
}
echo "</table>";
echo "<form method=POST action=insert.php>";
echo "<input type=submit value=Insert style='margin-left:620px; margin-top:10px'>";
echo "</form>";
echo "</body>";
echo "</html>";
mysql_close($con);
}
?>