頁面顯示資料庫
Ⅰ 如何解決Linux環境下訪問php頁面時,頁面上顯示資料庫代碼的問題
出現此問題的原因是由於在.htaccess文件中添加了下面兩行:
AddHandler application/x-httpd-php53 .php
AddHandler application/x-httpd-php54 .php
在這些行的開始位置插入#注釋掉之後就可以正常使用了。
Ⅱ 怎麼才能讓資料庫里的內容在html網頁裡面顯示
1、首先, sudo su postgres命令進入postgres,如下圖所示,然後進入下一步。
Ⅲ 在網頁怎麼顯示資料庫中的數據
用ListView綁定數據就可以了
舉例 "type「 "size" 是類的欄位 le是資料庫取出來的list集合
後台代碼
ListView1.DataSource = le ;
ListView1.DataBind();
前台代碼
<asp:ListView ID="ListView1" runat="server">
<ItemTemplate>
<table>
<tr>
<td>軟體分類</td>
<td><%#Eval("type")
%></div></td>
<td>軟體大小</td>
<td><%#Eval("size")
%></td>
</tr>
</ItemTemplate>
</asp:ListView>