小编noo*_*123的帖子

资源ID#4为什么我得到这个?

我有一个非常基本的论坛模板,我正在为测试目的而努力

当我创建主题并按提交时,进程更新数据库但不在屏幕上输出.为什么是这样?当我从以下代码回显$ result时,为什么我得到资源ID#4:

<?php

$host="server"; // Host name 
$username="usernamehere"; // Mysql username 
$password=""; // Mysql password 
$db_name="forum"; // Database name 
$tbl_name="question"; // Table name 

// Connect to server and select databse.
mysql_connect("$host", "$username", "")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending

$result=mysql_query($sql);
echo $result;
?>
<html>
<body>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
<td width="53%" align="center" bgcolor="#E6E6E6"><strong>Topic</strong></td> …
Run Code Online (Sandbox Code Playgroud)

php mysql

4
推荐指数
2
解决办法
5万
查看次数

标签 统计

mysql ×1

php ×1