มันขึ้นเออเร่อว่า
Warning:session_start()[function.session-start]: Cannot send session cache limiter-headers already sent (output started at C\:xampp\htdocs\project\popupDatabase.php:6)in C\:xampp\htdocs\project\popupDatabase.php on line 7
PrimitiveDatabase
s
============================= Code (PHP)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ฐานข้อมูล</title>
</head>
<?php
session_start();
$db_hostname="localhost";
$db_username="root";
$db_password="1234";
$db_name="myproject";
$connect=mysql_connect($db_hostname,$db_username,$db_password)or die("Not connect database");
mysql_select_db($db_name) or die("เลือกฐานข้อมูลไม่ได้");
mysql_query("SET NAMES UTF8");
$dbID=$_SESSION[dbID];
//find db name
$sqlFind="SELECT dbName FROM database_info WHERE dbID='$dbID'";
$resultFind=mysql_query($sqlFind) or die (mysql_error());
$rowFind=mysql_fetch_array($resultFind);
$dbName=$rowFind["dbName"];
echo $dbName;
mysql_select_db($dbName) or die("เลือกฐานข้อมูลไม่ได้ 2");
$sqlShowTable="SHOW TABLES FROM $dbName";
$resultShowTable=mysql_query($sqlShowTable) or die (mysql_error());
while($rowShowTable=mysql_fetch_array($resultShowTable))
{
$rowShowTable=mysql_fetch_array($resultShowTable);
$table=$rowShowTable[0];
echo "<br>".$table;
$sqlCoName="SHOW COLUMNS FROM $table";
?>
<table width="600" border="1">
<tr>
<?php
$resultCoName=mysql_query($sqlCoName);
while($rowCoName=mysql_fetch_array($resultCoName))
{
?>
<th width="100"> <div align="center"><?php echo $rowCoName[0];?></div></th>
<?php
}
?>
</tr>
<?php
$sqlRow="SELECT * FROM $table";
$result=mysql_query($sqlRow) or die (mysql_error());
$ncol=mysql_num_fields($result);
while($row=mysql_fetch_array)
{
?>
<tr>
<?php
for($i=0;$i<$ncol;$i++)
{
?>
<td><div align="center"><?=$row[$i];?></div></td>
<?php
}
?>
</tr>
<?php
}
//}
?>
</table>
<body>
</body>
</html>