php Warning: mysql_query() expects parameter 2 to be resource
$database="test";$tablename=$_REQUEST['tablename'];echo"<h2>Datafrom$tablename</h2>";...
$database = "test";
$tablename = $_REQUEST['tablename'];
echo "<h2>Data from $tablename</h2>";
include('conn.php');
$query = "show columns from $tablename";
$result = mysql_query($query,$tablename);
$column = 0;
if ($tablename && $query)
{
echo "Found these entries in the database:<br><p></p>";
echo "<table width=90% align=center border=1><tr>";
while ($r = mysql_fetch_array($result))
{
echo "<td align=center bgcolor=#00FFFF>$r[0]</td>";
$colname[$column] = $r[0];
$column = $column + 1;
}
echo "</tr>"; 展开
$tablename = $_REQUEST['tablename'];
echo "<h2>Data from $tablename</h2>";
include('conn.php');
$query = "show columns from $tablename";
$result = mysql_query($query,$tablename);
$column = 0;
if ($tablename && $query)
{
echo "Found these entries in the database:<br><p></p>";
echo "<table width=90% align=center border=1><tr>";
while ($r = mysql_fetch_array($result))
{
echo "<td align=center bgcolor=#00FFFF>$r[0]</td>";
$colname[$column] = $r[0];
$column = $column + 1;
}
echo "</tr>"; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询