我正在尝试为我的网站编写一个基本的消息传递系统。我已经设置了发送和接收,但由于某些原因,收件箱上的html停止显示。它在页面中途显示,然后由于某种原因而停止。甚至不会显示基本的html,就像我输入
你好
它不会出现的。我很困惑,因为这以前从来没有发生过。
</table>
<p>Hello</p><!--THIS WILL DISPLAY-->
<?php
///////////End take away///////////////////////
// SQL to gather their entire PM list
include_once ('../../mysql_server/connect_to_mysql.php');
$sql = mysql_query("SELECT * FROM messaging WHERE to_id='$my_id' AND recipientDelete='0' ORDER BY id DESC LIMIT 100");
while($row = mysql_fetch_array($sql)){
$date = strftime("%b %d, %Y",strtotime($row['time_sent']));
if($row['opened'] == "0"){
$textWeight = 'msgDefault';
} else {
$textWeight = 'msgRead';
}
$fr_id = $row['from_id'];
// SQL - Collect username for sender inside loop
$ret = mysql_query("SELECT * FROM myMembers WHERE id='$fr_id' LIMIT 1");
while($raw = mysql_fetch_array($ret)){ $Sid = $raw['id']; $Sname = $raw['firstname']; }
?>
<p>Hello</p><!--THIS WON'T DISPLAY-->
<table width="96%" border="0" align="center" cellpadding="4">任何帮助都将不胜感激..
编辑:
第一个while循环在表之后关闭。第一个while循环外的所有内容都会显示,而while循环内的所有内容则不会显示。
发布于 2012-05-19 06:32:43
不知道这是否只是一个剪切和粘贴错误,但是您的第一个while循环看起来并不是闭合的。试着关闭它,看看它会变成什么样子。
while($row = mysql_fetch_array($sql)){ //needs closing编辑:您是否尝试过查看您的sql是否抛出任何错误:
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$sql) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}这个PHP link可能会很有用。
https://stackoverflow.com/questions/10660481
复制相似问题