Location: PHPKode > projects > WWW-Admin > wwwadmin-0.1lt/sql_fields.php
<?
session_start();
error_reporting ( 1 );
?>
<html>
<body>
<title>WWW-Admin v0.1.0 : SQL</title>
<body bgcolor="#000000" style="font-family:times;color:white;">
<h4>Dumenu bazes irasai</h4>
<?

$db = $_POST['db'];
$user = $_POST['user'];
$pass = $_POST['pass'];
$serv = $_POST['server'];
$table = $_POST['table'];

echo "{$user}@{$serv}<br><br>";
if (!mysql_connect($serv, $user, $pass)) 
{
   echo "Negalima prisijungti prie {$db}@{$serv}";
   exit;
}
else{$con = mysql_connect($serv, $user, $pass);}

$result = mysql_select_db($db, $con);

if (!$result) 
{
   echo "DB klaida, negalima parodyti lenteliu<br>";
   echo 'MySQL klaida: '.mysql_error();
   exit;
}

if(!empty($_POST['query']))
{
	mysql_query($_POST['query']) or die ("Negalima ivykdyti komandos");
}

$res = mysql_query("select * from $table", $con);
$num_rows = mysql_num_fields($res);
echo "<h5>Lenteles :</h5>";
for ($i = 0; $i < $num_rows; $i++) 
{
		echo "<table border = 1>";
   		$name = mysql_field_name($res, $i);
		echo "<tr><td>".$name."</td></tr>";
	
}
echo "</table><br>";
mysql_free_result($result);
echo "Vykdyti komanda:";
echo "<form method = POST action = sql_fields.php>";
echo "<input type = text name = query value = >";
echo "<input type = submit name = butt value = Vykdyti>";
echo "</form>";

echo "<a href=ftp.php>FTP</a>"."<br>";
echo "<a href=port.php>Informacijos rinkejas</a>"."<br>";
?>
<a href="Index.php"> Atgal i prisijungimo puslapi.</a>
</font>
</body>
</html>
Return current item: WWW-Admin