mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-23 13:50:30 +03:00
added db.php - it's to show whose paid to have "powered by" taken off
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@703 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
21d38e3fd9
commit
a5736fc53f
48
site/db.php
Normal file
48
site/db.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<html><head><title>Database</title></head><body>
|
||||||
|
<?php
|
||||||
|
$db_host = 'localhost';
|
||||||
|
$db_user = 'openwebi_ed';
|
||||||
|
$db_pwd = 'qwe123qwe';
|
||||||
|
|
||||||
|
$database = 'openwebi_Copywritedb';
|
||||||
|
$table = 'site';
|
||||||
|
|
||||||
|
if (!mysql_connect($db_host, $db_user, $db_pwd))
|
||||||
|
die("Can't connect to database");
|
||||||
|
|
||||||
|
if (!mysql_select_db($database))
|
||||||
|
die("Can't select database");
|
||||||
|
|
||||||
|
// sending query
|
||||||
|
$result = mysql_query("SELECT * FROM {$table}");
|
||||||
|
if (!$result) {
|
||||||
|
die("Query to show fields from table failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields_num = mysql_num_fields($result);
|
||||||
|
|
||||||
|
echo "<h1>Table: {$table}</h1>";
|
||||||
|
echo "<table border='1'><tr>";
|
||||||
|
// printing table headers
|
||||||
|
for($i=0; $i<$fields_num; $i++)
|
||||||
|
{
|
||||||
|
$field = mysql_fetch_field($result);
|
||||||
|
echo "<td>{$field->name}</td>";
|
||||||
|
}
|
||||||
|
echo "</tr>\n";
|
||||||
|
// printing table rows
|
||||||
|
while($row = mysql_fetch_row($result))
|
||||||
|
{
|
||||||
|
echo "<tr>";
|
||||||
|
|
||||||
|
// $row is array... foreach( .. ) puts every element
|
||||||
|
// of $row to $cell variable
|
||||||
|
foreach($row as $cell)
|
||||||
|
echo "<td>$cell</td>";
|
||||||
|
|
||||||
|
echo "</tr>\n";
|
||||||
|
}
|
||||||
|
mysql_free_result($result);
|
||||||
|
?>
|
||||||
|
|
||||||
|
</body></html>
|
Loading…
Reference in New Issue
Block a user